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

Re: My bash script is missing something - what?



On 2016-10-10 10:57, Greg Wooledge wrote:
> On Mon, Oct 10, 2016 at 11:51:37AM -0400, songbird wrote:
>> Richard Owlett wrote:
>> > I have a trivial bash script named test.sh which has been marked
>> > as executable.
> 
>>   also remember that test itself is a builtin
>> or binary on some systems.
> 
> It's required by POSIX, so it will be a command on *every* system.
> Whether it's a shell builtin is not specified, but every modern shell
> makes it a builtin -- even dash.
> 
>>   you may be running on thing and thinking
>> you are running another.
>>
>>   in this particular case with the .sh
>> extension you are safe, but forget that
>> once and ...
> 
> Yes, this is excellent advice.  After being bitten by this once or twice
> in my early Unix years, I stopped making commands called "test" and made
> commands called "foo", "bar", "foobar", etc.
This is a very good point, and one example on Debian Wheezy:
Look at /usr/bin/test
and see 
'man test'
or 
'info coreutils 'test invocation''
-------
http://elchanate.org/


Reply to: