Hyphen char after shebang notation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Hyphen char after shebang notation
# 1  
Old 07-15-2010
Hyphen char after shebang notation

Hi,

I have a trivial question to ask, I am seeing in some shell scripts the '-' (hyphen) character following the first line of shell script (i.e) the shebang notation as follows:
Code:
#!/bin/sh -
#! /bin/bash -

what does the hyphen signify? What will happen if it is not given explicitly?
# 2  
Old 07-15-2010
This could be helpful.
# 3  
Old 07-15-2010
In addition you could read this article written by Perderabo,
Part 3 -- SUID Shell Scripts explains the meaning of the dash after the interpreter name.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: scientific notation to decimal notation

hello folks, I have few values in a log which are in scientific notation. I am trying to convert into actual decimal format or integer but couldn't able to convert. Values in scientific notation: 1.1662986666666665E-4 2.0946799999999998E-4 3.0741333333333333E-6 5.599999999999999E-7... (2 Replies)
Discussion started by: scriptscript
2 Replies

2. Shell Programming and Scripting

Scripts without shebang

I see lot of ad-hoc shell scripts in our servers which don't have a shebang at the beginning . Does this mean that it will run on any shell ? Is it a good practice to create scripts (even ad-hoc ones) without shebang ? (16 Replies)
Discussion started by: kraljic
16 Replies

3. Shell Programming and Scripting

Necessity of shebang line

Hi , I know about the shebang line in shell scripting. Just want to know whether is there any difference in execution of the program by keeping and not keeping the shebang line. Because without shebang line also the script is working. correct me if am wrong. Any help on this will be helpful (5 Replies)
Discussion started by: rogerben
5 Replies

4. Shell Programming and Scripting

Convert decimal notation to ANSI point code notation

wondering if anyone has any thoughts to convert the below thru a shell script Convert decimal signalling point notation to ANSI point code notation There is a site that does that conversion but i need to implement the solution in a shell script.....Thoughts.... OS: Solaris 9 ... (4 Replies)
Discussion started by: aavam
4 Replies

5. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

6. Shell Programming and Scripting

Shebang

If i am not using #! in my script. By default where will be my script running? (6 Replies)
Discussion started by: Kochu77
6 Replies

7. Shell Programming and Scripting

The Shebang!

Hi, I always thought that #!/usr/bin/ksh means that the script would be executed in korn shell i.e. when we'll execute the script with this line as the very first line then the shell spawns a korn shell (in this case as we are using #!/usr/bin/ksh ) and the script gets executed. But I am... (7 Replies)
Discussion started by: dips_ag
7 Replies

8. Programming

Adding a single char to a char pointer.

Hello, I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it: char* getext(char *file) { char *extension; int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies

9. Shell Programming and Scripting

Shebang

Hi, I am currently writing BASH shell scripts. I am using BASH on a Powerbook G4 running Leopard. Could somebody please explain the difference between #!/bin/bash and #!/bin/sh? I have been using the latter (#!/bin/sh), and things have been working fine. But is that the correct one to use... (9 Replies)
Discussion started by: msb65
9 Replies
Login or Register to Ask a Question