Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it.
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
So, I'd like for:
$ someCommand "${@/$/\/*.c}"
to work, but it does not. This is b/c the above bash syntax doesn't deal
in reg exps; it is some other kind of pattern matcher.
I seem to remember that there is a way to do this, but I can't recall it
ATM. Any ideas?
gazelle@shell.xmission.com (Kenny McCormack) writes:
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it.
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
I seem to remember that there is a way to do this, but I can't recall it
ATM. Any ideas?
echo "${@/*/&\/*.c}"
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it.
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
I seem to remember that there is a way to do this, but I can't recall it
ATM. Any ideas?
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
So, I'd like for:
$ someCommand "${@/$/\/*.c}"
to work, but it does not. This is b/c the above bash syntax doesn't deal
in reg exps; it is some other kind of pattern matcher.
I seem to remember that there is a way to do this, but I can't recall it
ATM.
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it.
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
So, I'd like for:
$ someCommand "${@/$/\/*.c}"
to work, but it does not. This is b/c the above bash syntax doesn't deal
in reg exps; it is some other kind of pattern matcher.
I seem to remember that there is a way to do this, but I can't recall it
ATM. Any ideas?
$ arr=( foo bar bletch )
$ printf "'%s'\n" "${arr[@]/%/.c}"
Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
gazelle@shell.xmission.com (Kenny McCormack) writes:
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it. >>>
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
I seem to remember that there is a way to do this, but I can't recall it >>> ATM. Any ideas?
echo "${@/*/&\/*.c}"
But there is also new syntax I've not seem before:
echo "${@/%/\/*.c}"
(/# and /% match at the beginning and the end so here we match nothing
at the end)
In article <87h6ygb...@bsb.me.uk>,
Ben Bacarisse <ben.u...@bsb.me.uk> wrote:
Ben Bacarisse <ben.u...@bsb.me.uk> writes:
gaz...@shell.xmission.com (Kenny McCormack) writes:
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it. >>>
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each. >>
I seem to remember that there is a way to do this, but I can't recall it >>> ATM. Any ideas?
echo "${@/*/&\/*.c}"
But there is also new syntax I've not seem before:
echo "${@/%/\/*.c}"
(/# and /% match at the beginning and the end so here we match nothingThanks. These both looks like useful suggestions. I haven't tested them
at the end)
yet, but it looks right.
--
A 70 year old man who watches 6 hours of TV a day, plays a lot of golf
and seems to always be in Florida is a retiree, not a president.
you are looking for shell brace expansion:
In article <556afb46-f290-42d4...@googlegroups.com>,
applemcg <marty....@gmail.com> wrote:
you are looking for shell brace expansion:No, I'm not.
You might want to re-read the original post.
--
It's all Al Gore's fault...
On Thursday, December 1, 2022 at 9:43:19 AM UTC-5, Kenny McCormack wrote:...
In article <556afb46-f290-42d4...@googlegroups.com>,
applemcg <marty....@gmail.com> wrote:
you are looking for shell brace expansion:No, I'm not.
You might want to re-read the original post.
Why not this then, I missed the slash:
lib.$ set {foo,bar,zot}/*.c
lib.$ ea
3 foo/*.c bar/*.c zot/*.c
lib.$
p.s. i somehow got hooked on "zot" as rounding out the trio.
might i ask why shell brace expansion isn't a solution.
On 30.11.2022 18:59, Kenny McCormack wrote:
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it.
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
So, I'd like for:
$ someCommand "${@/$/\/*.c}"
to work, but it does not. This is b/c the above bash syntax doesn't deal
in reg exps; it is some other kind of pattern matcher.
You've already got an answer using ${var/%...} which can (obviously in
bash and zsh, but not in ksh) be simply written as "${@/%/.c}"
$ set -- foo bar bletch
$ echo "${@/%/.c}"
(the more complex syntax in the other post produces "foo\/*.c bar\/*.c bletch\/*.c" in my environment which is not what I'd expect)
If you want to avoid using/overwriting the positional parameters you can
also use that pattern with array variables
$ arr=( foo bar bletch )
$ printf "'%s'\n" "${arr[@]/%/.c}"
I seem to remember that there is a way to do this, but I can't recall it
ATM. Any ideas?
Unless having a need for the arguments to be stored as $@, and the 'set'
is just a part of the test sample you can use brace expansion (at least
for constant file lists) like
$ echo {foo,bar,bletch}.c
Janis
Janis Papanagnou
On 30/11/2022 20:03, Janis Papanagnou wrote:
Janis Papanagnou
just a nickname, i have seen on google search, they may deem Janis as woman perhaps not
On 30/11/2022 19:59, Janis Papanagnou wrote:
Janis
So what does Janis mean? Is that a nickname?
Well, I wonder, Janis Joplin. Like a bi singer.+
That would be too great to have a woman looking at our code
On 18.01.2023 04:31, castAway wrote:
On 30/11/2022 19:59, Janis Papanagnou wrote:
Janis
So what does Janis mean? Is that a nickname?
It's a common forename you find in western Christian cultures that is
very common in many countries in their own country specific forms.
Mine stems from the Greek culture where the non-abbreviated spelling
is Ioannis. In anglo-american cultures it's usually written as Yanis;
see also the prominent Yanis Varoufakis (university professor in the
USA, IIRC, and temporarily part of the Greek government during the
financial crisis a decade ago).
So, no, it's (in this case) not a nickname. I prefer posting by real
name, while otherwise trying to keep my privacy intact - if (e.g.)
(OTOH it's indeed strange that there's so few (or even no) female
posters around here.)
On Wed, 18 Jan 2023 06:34:53 +0100
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
On 18.01.2023 04:31, castAway wrote:
On 30/11/2022 19:59, Janis Papanagnou wrote:
Janis
So what does Janis mean? Is that a nickname?
It's a common forename you find in western Christian cultures that is
very common in many countries in their own country specific forms.
Like John in English or Johannes in German.
On 18.01.2023 04:31, castAway wrote:
..
Well, I wonder, Janis Joplin. Like a bi singer.+
I always wondered whether that was a phonetic transcription of the
name Janice or a normal female name in the USA. Besides Janis Joplin
I've never seem that name given to a woman (but who am I to know).
(OTOH it's indeed strange that there's so few (or even no) female
posters around here.)
On Wed, 18 Jan 2023 06:34:53 +0100
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
(OTOH it's indeed strange that there's so few (or even no) female
posters around here.)
If it helps, I read this group sometimes. But I've never posted here... before now.
We do exist!
- Sophie.
On 18.01.2023 04:31, castAway wrote:
On 30/11/2022 19:59, Janis Papanagnou wrote:
Janis
So what does Janis mean? Is that a nickname?
It's a common forename you find in western Christian cultures that is
very common in many countries in their own country specific forms.
Mine stems from the Greek culture where the non-abbreviated spelling
is Ioannis. In anglo-american cultures it's usually written as Yanis;
see also the prominent Yanis Varoufakis (university professor in the
USA, IIRC, and temporarily part of the Greek government during the
financial crisis a decade ago).
So, no, it's (in this case) not a nickname. I prefer posting by real
name, while otherwise trying to keep my privacy intact - if (e.g.)
you're using google to find pictures of me you get only pictures of
other persons (even female ones) despite, I dare to say, that Janis Papanagnou is a quite unique name combination even world wide.
Well, I wonder, Janis Joplin. Like a bi singer.+
I always wondered whether that was a phonetic transcription of the
name Janice or a normal female name in the USA. Besides Janis Joplin
I've never seem that name given to a woman (but who am I to know).
That would be too great to have a woman looking at our code
I'm sorry to have to disappoint you here. :-)
Myself I prefer to not distinguish personalities by gender; respect
everyone as he or she deserves it.
(OTOH it's indeed strange that there's so few (or even no) female
posters around here.)
Janis
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
On 18.01.2023 04:31, castAway wrote:
On 30/11/2022 19:59, Janis Papanagnou wrote:
Janis
So what does Janis mean? Is that a nickname?
It's a common forename you find in western Christian cultures that is
very common in many countries in their own country specific forms.
Mine stems from the Greek culture where the non-abbreviated spelling
is Ioannis. In anglo-american cultures it's usually written as Yanis;
see also the prominent Yanis Varoufakis (university professor in the
USA, IIRC, and temporarily part of the Greek government during the
financial crisis a decade ago).
So, no, it's (in this case) not a nickname. I prefer posting by real
name, while otherwise trying to keep my privacy intact - if (e.g.)
you're using google to find pictures of me you get only pictures of
other persons (even female ones) despite, I dare to say, that Janis
Papanagnou is a quite unique name combination even world wide.
Well, I wonder, Janis Joplin. Like a bi singer.+
I always wondered whether that was a phonetic transcription of the
name Janice or a normal female name in the USA. Besides Janis Joplin
I've never seem that name given to a woman (but who am I to know).
That would be too great to have a woman looking at our code
I'm sorry to have to disappoint you here. :-)
Myself I prefer to not distinguish personalities by gender; respect
everyone as he or she deserves it.
(OTOH it's indeed strange that there's so few (or even no) female
posters around here.)
Janis
I found this:
What does Janis mean?
Janis Pronunciation of Janis ? as a name for girls is a Hebrew name,
and Janis means "God is gracious". Janis is an alternate spelling
of Jane (Hebrew): originally a feminine respelling of John. Janis
is also a variation of Janice (Hebrew).
http://www.thinkbabynames.com/meaning/0/Janis
http://www.thinkbabynames.com/meaning/0/Janis
And in Latvian Janis (there's a squiggle over the N, I think) is pronounced YAWN-iss and is the Latvian equivalent of "John".
The diacritic in this case is a bar (macron) over the a: J?nis.
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it.
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
So, I'd like for:
$ someCommand "${@/$/\/*.c}"
to work, but it does not. This is b/c the above bash syntax doesn't deal
in reg exps; it is some other kind of pattern matcher.
I seem to remember that there is a way to do this, but I can't recall it
ATM. Any ideas?
On 30/11/2022 at 18:59, Kenny McCormack wrote :
Note: not looking for workarounds, got plenty of my own.
In particular, if you have to code a loop, that takes the fun out of it.
Anyway, suppose I do:
$ set -- foo bar bletch
I want to pass these args to a subprogram with "/*.c" appended to each.
So, I'd like for:
$ someCommand "${@/$/\/*.c}"
to work, but it does not. This is b/c the above bash syntax doesn't deal
in reg exps; it is some other kind of pattern matcher.
I seem to remember that there is a way to do this, but I can't recall it
ATM. Any ideas?
Hi,
$ set -- cp dd
$ echo ${@/%/\/*.c}
cp/cp.c cp/utils.c dd/args.c dd/conv.c dd/conv_tab.c dd/dd.c dd/gen.c >dd/misc.c dd/position.c
$ echo "${@/%/\/*.c}"
cp/*.c dd/*.c
/% means replace from the end
/# from the beginning
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 376 |
Nodes: | 16 (2 / 14) |
Uptime: | 52:29:17 |
Calls: | 8,041 |
Files: | 13,037 |
Messages: | 5,831,890 |