Re: idea: statically-linked "busy-bash"

2009-04-09 Thread Andreas Schwab
Richard Neill writes: > What I'm suggesting is to experimentally build a version of bash which has > mv/cp/ls/stat/grep/ all built in. This is possible without rebuilding bash, see the documentation of the `enable' builtin. There are already a few examples in the bash distribution under ex

Re: str1 < str2 does not respect locale

2009-04-09 Thread Chet Ramey
> > > Strings compared with [[ string1 < string2 ]] are supposed to use > > > the current locale, but they don't. > > > > It's a documentation error (but a long-standing one). The code has > > always used strcmp, not strcoll. > > how about change it to strcoll then ? I'll consider that as a poss

Re: idea: statically-linked "busy-bash"

2009-04-09 Thread Richard Neill
Andreas Schwab wrote: What I'm suggesting is to experimentally build a version of bash which has mv/cp/ls/stat/grep/ all built in. This is possible without rebuilding bash, see the documentation of the `enable' builtin. There are already a few examples in the bash distribution under exam

how to pass arguments with space inside?

2009-04-09 Thread lehe
Hi, I was wondering how to pass arguments with space inside. For example, my bash script looks like: #!/bin/bash ARG_OPTS="" while [[ -n "$1" ]]; ARG_OPTS="${ARG_OPTS} $1" shift done If I pass an argument like "--options='-t 0 -v 0'", then it would be splitted by the spaces ins

Re: how to pass arguments with space inside?

2009-04-09 Thread Mike Frysinger
On Thursday 09 April 2009 16:46:27 lehe wrote: > I was wondering how to pass arguments with space inside. For example, my > bash script looks like: > > #!/bin/bash > ARG_OPTS="" > while [[ -n "$1" ]]; > ARG_OPTS="${ARG_OPTS} $1" > shift > done > > If I pass an argument like "--options

Re: how to pass arguments with space inside?

2009-04-09 Thread lehe
Thanks Mike. Could you explain it a little? I don't quite get it. How to apply this to argument parsing? Mike Frysinger wrote: > > On Thursday 09 April 2009 16:46:27 lehe wrote: >> I was wondering how to pass arguments with space inside. For example, my >> bash script looks like: >> >> #!/bin/b

Re: how to pass arguments with space inside?

2009-04-09 Thread lehe
Actually in the bash script there is a command that passes "--options='-t 0 -v 0'" as argument to an executable. I just found if I double quote --options='-t 0 -v 0' as argument to the bash script, then the '-t 0 -v 0' as a whole can be preserved until reaching the command invoking the executable

Re: how to pass arguments with space inside?

2009-04-09 Thread Mike Frysinger
On Thursday 09 April 2009 17:47:59 lehe wrote: > Thanks Mike. please do not top post > Mike Frysinger wrote: > > On Thursday 09 April 2009 16:46:27 lehe wrote: > >> I was wondering how to pass arguments with space inside. For example, my > >> bash script looks like: > >> > >> #!/bin/bash > >> ARG

Re: how to pass arguments with space inside?

2009-04-09 Thread lehe
Forgot to say in the bash script, the call to the executable is like: my_executable ${ARG_OPTS} lehe wrote: > > Actually in the bash script there is a command that passes "--options='-t > 0 -v 0'" as argument to an executable. I just found if I double quote > --options='-t 0 -v 0' as argument

Re: how to pass arguments with space inside?

2009-04-09 Thread lehe
Sorry. I won't top post again. I tried your way but ARG_OPTS only accept the first argument and ignore the rest. Mike Frysinger wrote: > > On Thursday 09 April 2009 17:47:59 lehe wrote: >> Thanks Mike. > > please do not top post > >> Mike Frysinger wrote: >> > On Thursday 09 April 2009 16:46:

Re: how to pass arguments with space inside?

2009-04-09 Thread Chris F.A. Johnson
On Thu, 9 Apr 2009, lehe wrote: Sorry. I won't top post again. You just did! I tried your way but ARG_OPTS only accept the first argument and ignore the rest. ARG_OPTS=( "$@" ) All the arguments are now in the array ARG_OPTS: printf "%s\n" "${arg_op...@]}" Mike Frysinger wrote: