Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: why is SHINSTDIN an option?
- X-seq: zsh-workers 920
- From: schaefer@xxxxxxxxxxxxxx (Barton E. Schaefer)
- To: "Richard J. Coleman" <coleman@xxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxxxxxxx
- Subject: Re: why is SHINSTDIN an option?
- Date: Wed, 10 Apr 1996 22:17:37 -0700
- In-reply-to: "Richard J. Coleman" <coleman@xxxxxxxxxxxxxxx> "why is SHINSTDIN an option?" (Apr 11, 12:13am)
- References: <199604110413.AAA24507@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: schaefer@xxxxxxxxxxxxxx
On Apr 11, 12:13am, Richard J. Coleman wrote:
} Subject: why is SHINSTDIN an option?
}
} Is there any reason for SHINSTDIN to be an option?
} is there any time where a user would want to set this himself?
I think it's an option mostly so it can be tested, rather than set.
if [[ -o shinstdin ]]
then
echo "I was run with 'zsh < somefile', so \$0 is zsh"
else
echo "I was run with 'zsh $0' or '. $0' or just as '$0'"
fi
I suppose there might be some reason to want to spoof the above by
setopt/unsetopt of shinstdin, but I can't think of one offhand.
Further, it could conceivably have other uses, particularly as a
command-line option. Consider:
#! /usr/local/bin/zsh -s
echo This does not happen.
I'd be reluctant to eliminate the option, if that's what you are
thinking about.
--
Bart Schaefer Vice President, Technology, Z-Code Software
schaefer@xxxxxxxxxx Division of NCD Software Corporation
http://www.well.com/www/barts
Messages sorted by:
Reverse Date,
Date,
Thread,
Author