[CentOS] Real sh? Or other efficient shell for non-interactive scripts
John R Pierce
pierce at hogranch.comFri Apr 24 19:47:50 UTC 2015
- Previous message: [CentOS] Real sh? Or other efficient shell for non-interactive scripts
- Next message: [CentOS] Real sh? Or other efficient shell for non-interactive scripts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 4/24/2015 12:32 PM, Gordon Messmer wrote: > On 04/24/2015 09:59 AM, Steve Lindemann wrote: >> >> A script with no shebang will run in the environment of the account >> running the script. > > Bad test on my part, apparently. > > $ python > >>> import os > >>> os.execv('/home/gmessmer/test', ('test',)) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > OSError: [Errno 8] Exec format error > > So a script with no shebang will fail when the shell calls exec(). If > that's so, then starting the executable script with an interpreter is > probably shell-defined. In other words, each shell might do something > different to run a script that has no shebang. Most probably do > default to trying itself as the interpreter first. Interesting. is file test chmod +x ? -- john r pierce, recycling bits in santa cruz
- Previous message: [CentOS] Real sh? Or other efficient shell for non-interactive scripts
- Next message: [CentOS] Real sh? Or other efficient shell for non-interactive scripts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list