[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set -n ruins shell

From: George Herson
Subject: Re: set -n ruins shell
Date: Wed, 19 Sep 2001 18:09:15 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010701

Paul Jarc wrote:

George Herson <address@hidden> wrote:
address@hidden /root]# cat > /tmp/tmpscript
echo "hello"
address@hidden /root]# bash -c "set -n /tmp/tmpscript"  # line 2

This sets the -n flag, and then sets $1 to "/tmp/tmpscript".  If you
want to set the -n flag, and then source the script, do this:
bash -c 'set -n; . /tmp/tmpscript'

Thanks, but why am i still getting zero output?

address@hidden /root]# bash -c 'set -n; . /tmp/tmpscript'
address@hidden /root]# chmod u+x /tmp/tmpscript
address@hidden /root]# bash -n /tmp/tmpscript
address@hidden /root]#

Should i try a "real" syntax error?  like what?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]