Re: Calling Bash with /S

2011-06-23 Thread sweinberger
Roman Rakus wrote: > > On 06/22/2011 06:59 PM, sweinberger wrote: >> Hi All, >> >> I am calling bash from dmake. The make file initiates the call to bash >> as >> follows: >> >> /bin/bash /S /c "" > /bin/bash -S -c ? > Anyway, -S is not valid option in Fedora's bash version 4.1.7. >> The comma

Re: Calling Bash with /S

2011-06-23 Thread sweinberger
Hi All, With help from a colleague, I found out part of the problem. First, though, I should give some background for anyone that may run into the same problem. Environment: dmake: downloaded latest version: dmake.exe - Version 4.12-20090907-SHAY Cygwin: latest version: 1.7.9-1 The /S /c come

Re: Question about patterns

2011-06-23 Thread Chet Ramey
On 6/23/11 9:59 AM, Steven W. Orr wrote: > I may be wrong, but I think there's a way to do what I want without using a > regex. > > I have a file called foo-1.2-3.tar.gz > I need to set a variable equal to > foo-1.2-i386-x86_64-3.tar.gz > > Is there a way to do this without parsing my brains out?

Re: Question about patterns

2011-06-23 Thread Roman Rakus
On 06/23/2011 04:56 PM, Roman Rakus wrote: On 06/23/2011 03:59 PM, Steven W. Orr wrote: I may be wrong, but I think there's a way to do what I want without using a regex. I have a file called foo-1.2-3.tar.gz I need to set a variable equal to foo-1.2-i386-x86_64-3.tar.gz Is there a way to do

Re: Calling Bash with /S

2011-06-23 Thread sweinberger
Hi All, Success! The solution is to move the if-statement inside the bash command string. "$(OBJ)/%.o" :| "$(SRC)/%.c" $(SRCDIRS:+"/%.c") @+bash -c 'if [ `expr "$(NOOPTSRCS)" : '.*\b$(<:f)\b'` == 0 ]; then echo Compiling: $(<:f); $(CC) ... "$<"; fi' @+bash -c 'if [ `expr "$

Re: Question about patterns

2011-06-23 Thread Roman Rakus
On 06/23/2011 03:59 PM, Steven W. Orr wrote: I may be wrong, but I think there's a way to do what I want without using a regex. I have a file called foo-1.2-3.tar.gz I need to set a variable equal to foo-1.2-i386-x86_64-3.tar.gz Is there a way to do this without parsing my brains out? I am fac

Re: Calling Bash with /S

2011-06-23 Thread sweinberger
Hi All, With help from a colleague, I found out part of the problem. First, though, I should give some background for anyone that may run into the same problem. Environment: dmake: downloaded latest version: dmake.exe - Version 4.12-20090907-SHAY Cygwin: latest version: 1.7.9-1 The /S /c come

Question about patterns

2011-06-23 Thread Steven W. Orr
I may be wrong, but I think there's a way to do what I want without using a regex. I have a file called foo-1.2-3.tar.gz I need to set a variable equal to foo-1.2-i386-x86_64-3.tar.gz Is there a way to do this without parsing my brains out? I am facile with the variable operations like # ## %

Re: [RFC] support 'COMP_WORDBREAKS' value on a per-completion basis

2011-06-23 Thread Chet Ramey
On 5/30/11 2:05 PM, Raphaƫl Droz wrote: > It seems like if gnu.bash@googlegroups.com eat the first occurrence > of this email (not in the mailman archives)... second attempt: > > === Rationale: > Let's say you want to complete http URL (which contain ':'). > > The completion probably contains

Re: Calling Bash with /S

2011-06-23 Thread Greg Wooledge
On Wed, Jun 22, 2011 at 09:59:45AM -0700, sweinberger wrote: > /bin/bash /S /c "" ... MS-DOS 3.30? Or a modified version of bash? Or both? > In Make File: > @ls -l ./SomeDir/* > > Bash Command > /bin/bash /S /c "ls -l ./SomeDir/*" > > The /S from what I see enables regular expression processi

Re: printf treats arguments of "%c" not as expected

2011-06-23 Thread Greg Wooledge
> 2011/6/23 Jan Schampera : > > However, Mr. Wang may want to read one of Greg's brilliant FAQ entries [1]. > > [1] http://mywiki.wooledge.org/BashFAQ/071 On Thu, Jun 23, 2011 at 04:00:35PM +0800, Yunfeng Wang wrote: > Thanks Jan, Greg's solution is great! Just for the record, I didn't write the

Re: Calling Bash with /S

2011-06-23 Thread Roman Rakus
On 06/22/2011 06:59 PM, sweinberger wrote: Hi All, I am calling bash from dmake. The make file initiates the call to bash as follows: /bin/bash /S /c "" /bin/bash -S -c ? Anyway, -S is not valid option in Fedora's bash version 4.1.7. The command to execute is between the double quotes. For

Re: printf treats arguments of "%c" not as expected

2011-06-23 Thread Jan Schampera
Yunfeng Wang wrote: Perhaps bash should clarify this issue in its documents such that users like me would not be misguided again. Since the reference to printf(3) is misleading sometimes, I made some document [1] for Bash's printf only. It's far from perfect, but at least it mentions %s and

Re: printf treats arguments of "%c" not as expected

2011-06-23 Thread Yunfeng Wang
Thanks Jan, Greg's solution is great! wyf 2011/6/23 Jan Schampera : > Hi, > > > I agree this is not a bug. %c works as described. > > However, Mr. Wang may want to read one of Greg's brilliant FAQ entries [1]. > > In general it's a bit of a pity that printf can do character->number > conversion,

Re: printf treats arguments of "%c" not as expected

2011-06-23 Thread Yunfeng Wang
Hi Jonathan, I didn't check the POSIX spec, my fault ;-) So bash chooses to conform to POSIX regarding this behaviour, not bad I believe. But the help message of printf is somewhat misleading as it says: $ help printf printf: printf [-v var] format [arguments] Formats and prints ARGUMENTS und

Re: printf treats arguments of "%c" not as expected

2011-06-23 Thread Jan Schampera
Hi, I agree this is not a bug. %c works as described. However, Mr. Wang may want to read one of Greg's brilliant FAQ entries [1]. In general it's a bit of a pity that printf can do character->number conversion, but not (directly) back. But it is like it is and the "workarounds" are not reall