bug-bash
[Top][All Lists]
Advanced

[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 <gherson@snet.net> wrote:
[root@geodollar /root]# cat > /tmp/tmpscript
echo "hello"
echobad
[root@geodollar /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?

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


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

thx,

george




reply via email to

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