Re: how to pass arguments with space inside?

2009-04-10 Thread lehe
EBUG=yes || exit 1 DEBUGGER="gdb --args" ;; *) ARG_OPTS="${ARG_OPTS} $1" ;; esac shift done ${DEBUGGER} my_executable ${ARG_OPTS} [/code] Chris F.A. Johnson-3 wrote: > > On Thu, 9 Apr 2009, lehe wrote: > >> Sor

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: >

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 > -

Re: how to pass arguments with space inside?

2009-04-09 Thread lehe
0 -v 0' or --options="-t 0 -v 0" without quoting could be passed successfully as argument. Hope that I could explain my question clearly enough. Really appreciate your advice! lehe wrote: > > Thanks Mike. > Could you explain it a little? I don't quite get it. How t

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 l

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: Install Bashdb and Bash not as root

2009-03-05 Thread lehe
Sorry, Bob, it's my bad. ${HOME} in my previous posts were not described consistently. Actually my $HOME on my office server is "/cis/home/tingli". "'/cis/home/tingli/bin/bash-3.2.48/bin/bin/bash'" is actually where my new bash executable lies in the server (the double bins were left from my sill

"cannot execute binary file"

2009-03-05 Thread lehe
Hi, Lately I am trying to install a higher version of emacs under my ${HOME} on my office server. I add the new emacs path into PATH. It works quite well when I ssh to the server, but encounters this "/home/emacs/bin/emacs: cannot execute binary file" error when I am working on my office computer

Re: Install Bashdb and Bash not as root

2009-03-05 Thread lehe
ssfully. Looks like I can get only one work, either my office computer or my laptop. Bob Proulx wrote: > > lehe wrote: >> Since the old shell is the login shell reading ./bash_profile and the new >> one isn't but reading ./bashrc, how could there possibly be infinite &g

Re: Install Bashdb and Bash not as root

2009-03-04 Thread lehe
do in those spare terminals? I tried add PATH=mypath_for_bashdb:${PATH} to both ./bash_profile and ./bashrc. However emacs still saying no match to "M-x bashdb". Any help is appreciated! Thanks! Bob Proulx wrote: > > lehe wrote: >> I just solve my problem by adding the path of

Re: Install Bashdb and Bash not as root

2009-03-04 Thread lehe
is lauched in terminal, putty and in emacs. Is there a place where the change to PATH could be added and executed before bash starts, like ".bashrc" for when bash is lauched? 2. Also in emacs, if I type "M-x bashdb", bashdb is not "matched". How shall I set it up? Th

Install Bashdb and Bash not as root

2009-03-03 Thread lehe
Hi, I have no root access to a server, so I can only install bashdb under my $HOME. Unfortunately bashdb requires Bash 3.1 or 3.2 but the bash on the server is version 3.00.15. So I first installed bash 3.2 under my $HOME/bin/bash-3.2.48 /bin/ from its source. Then I run configuration of dashdb a

Re: order of redirections

2009-03-03 Thread lehe
Got it. Thank you very much! -- View this message in context: http://www.nabble.com/order-of-redirections-tp22298397p22316124.html Sent from the Gnu - Bash mailing list archive at Nabble.com.

order of redirections

2009-03-02 Thread lehe
Hi, I have some questions about the paragraph in Bash Reference on redirections: "Note that the order of redirections is significant. For example, the command ls > dirlist 2>&1 directs both standard output (file descriptor 1) and standard error (file descriptor 2) to the file dirlist, while

arguments to script prefixed with "--" in debug

2009-02-26 Thread lehe
Hi, I am trying to debug my shell script by bashdb. My script take as argument "--gdb", so I wrote bashdb myscript.sh --gdb However, this way it will produce error that bashdb: unrecognized option '--gdb' If I quote --gdb as bashdb myscript.sh '--gdb' then I will end up with the quote

Re: bashdb question

2009-02-26 Thread lehe
aken to bashdb prompt and instead get "BASH_EXECUTION_STRING='set|grep -i dbg'". So I guess my bashdb is not set up properly? Thanks! Chet Ramey wrote: > > lehe wrote: >> Hi, >> I am beginning to use bashdb to debug my shell script. There is one >>

restart debug in Bashdb with Emacs

2009-02-26 Thread lehe
Hi, I am using Bashdb in Emacs. Everytime when I reach "Debugger finished" at the end of the debugging, do I have to restart all over again from typing "M-x bashdb" if I'd like to debug again? Is it possible to save the typing? Thanks! -- View this message in context: http://www.nabble.com/resta

bashdb question

2009-02-26 Thread lehe
Hi, I am beginning to use bashdb to debug my shell script. There is one problems here. With "bash --debugger ./myscript.sh" it will run to finish without stop, while with "bashdb ./myscript.sh" would stop at the beginning. How could I stop in the first usage? Thanks a lot! -- View this message i