Re: How to protect > and interpret it later on? (w/o using eval)

2011-12-02 Thread Greg Wooledge
On Fri, Dec 02, 2011 at 09:00:10AM +0200, Pierre Gaston wrote: > On Fri, Dec 2, 2011 at 8:24 AM, Peng Yu wrote: > > $  ../execute.sh  ls >/tmp/tmp.txt What? You have a pipeline with nothing before it, and then another pipeline with "ls" on the right hand side. But ls doesn't even read from stdi

Re: How to protect > and interpret it later on? (w/o using eval)

2011-12-02 Thread Peng Yu
> WHAT are you trying to DO? I think that you might completely miss my point. I try to explain it better. Let me know if this time it makes more sense to you. I want to execute any command as if the 'execute.sh' does not present, except that I want to print the command so that I know want the com

Re: How to protect > and interpret it later on? (w/o using eval)

2011-12-02 Thread Greg Wooledge
On Fri, Dec 02, 2011 at 08:26:28AM -0600, Peng Yu wrote: > When I call, > > execute.sh ls > /tmp/tmp.txt > > I want it actually to do > > echo "ls > /tmp/tmp.txt" > ls > /tmp/tmp.txt That is impossible. The redirection, being unquoted, is performed by the shell where you are actually typing th

Re: *(.*) matches wrongly when dotglob unset

2011-12-02 Thread Chet Ramey
On 11/29/11 9:53 AM, Yongzhi Pan wrote: > Producing the bug: > > tux@dell:~$ shopt -s extglob > tux@dell:~$ shopt -u dotglob > tux@dell:~$ ls -d *(.*) > ls: cannot access *(.*): No such file or directory > tux@dell:~$ touch '*(.*)' > tux@dell:~$ ls -d *(.*) > *(.*) > > I think even if dotglob is

Re: A programmable completoin bug?

2011-12-02 Thread Chet Ramey
On 11/30/11 2:08 AM, Clark J. Wang wrote: > (Tested with bash 4.2.10 and 4.1.9) > > [bash-4.2.10] # cat foo.compspec > compspec_foo() > { > local cmd=$1 cur=$2 pre=$3 > > if [[ $cur = :* ]]; then > COMPREPLY=( changed changed/IGNORE_ME ) > fi > } > > complete -F compspec_foo

popd always has return status 0

2011-12-02 Thread james . cuzella
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA

Re: popd always has return status 0

2011-12-02 Thread Pierre Gaston
On Fri, Dec 2, 2011 at 2:01 AM, wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' > -DC

Re: popd always has return status 0

2011-12-02 Thread Mike Frysinger
On Thursday 01 December 2011 19:01:50 james.cuze...@lyraphase.com wrote: > Description: > popd does not appear to return a nonzero exit status when the directory > stack is empty anymore. works for me: $ echo $BASH_VERSION ; popd ; echo $? 4.2.20(1)-release bash: popd: directory stack empty