![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem when passing argument to a shell script | sumesh.abraham | Shell Programming and Scripting | 9 | 12-13-2006 12:07 PM |
| printing last argument in shell script | arunkumar_mca | Shell Programming and Scripting | 5 | 10-03-2006 09:32 PM |
| Argument list too long - Shell error | dad5119 | Shell Programming and Scripting | 8 | 03-03-2006 03:57 PM |
| shell script argument parsing | rmjoe | Shell Programming and Scripting | 1 | 07-28-2005 04:37 PM |
| shell: creating different arrays based on function argument | nix21 | Shell Programming and Scripting | 5 | 03-20-2005 11:34 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Shell script $0 argument
Hi,
If not running a shell script file in current shell (. ./fileName) then $0 represents the executable file name. But in case of invoking shell script file in current shell then i m getting "$0 as -bash" . In such case how can i get the program name (running shell script file name)? Thanks, |
|
||||
|
Right, you can't. The thing is, you're not executing the script when you call it like "bash scriptname." You're executing bash, and bash is using that file as input.
This is why you can still run "bash scriptname" when the file doesn't have execute permissions set. ShawnMilo |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|