The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bad magic number on /dev/md0 ravinandan UNIX for Advanced & Expert Users 0 08-17-2007 07:56 AM
LVM magic number 0x4D48 ghimanshu Filesystems, Disks and Memory 2 07-18-2007 08:27 AM
Bad Magic Number wesweshahaha Filesystems, Disks and Memory 0 05-18-2006 01:28 PM
Bad magic number batosai SUN Solaris 1 04-22-2006 11:29 AM
bad magic number rein UNIX for Advanced & Expert Users 5 01-05-2005 11:27 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-08-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
shell magic number with a -

In one of our internal scripts (unix.run), I have noticed that the following shebang.

Code:
#!/bin/sh -
for i in test1 test2 test3 ; do
.
.
.
Any idea what the - in the magic number stands for ?

And what impact does it have on the script ?


Continuing on the same script, I have the following for unix.run

Code:
ls -l unix.run
-rw-------    1 XXXXXX g900          187 Jul  8 04:29 unix.run
If I do a

Code:
./unix.run
it says 'Permission denied'

But if I run it as,

Code:
sh unix.run
it works well.

Why the difference in behaviour between ./unix.run and sh unix.run?

Shouldn't it always say 'Permision denied' in both the cases ?

Any inputs/pointers on these two points, highly appreciated.

Thanks,
Vino
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:45 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0