Reputation: 2137
Say for example a script begins like this
#!/bin/bash
#$ -S /bin/bash
#$ -l hostname=qn*
and then later down the page the actual script comes into play. My question is what does the "#$" symbol mean or do?
Upvotes: 6
Views: 4788
Reputation: 3521
Are you by any means running on a batch cluster? Like Sun Grid Engine? There might be special meanings in scripts intended to run as a batch job.
https://www.wiki.ed.ac.uk/display/EaStCHEMresearchwik/How+to+write+a+SGE+job+submission+script
Update:
above link blocks when used from stackoverflow.com (works from google.com)
alternatives:
Upvotes: 6
Reputation: 12946
They seem to be parameters for the Oracle (ex-Sun) Grid Engine, look at this SO question or this one.
They are heavily using these kind of comments.
Upvotes: 1
Reputation: 26086
Lines beginning with #
are comments. The first line may begin with #!
, but it's still a comment to bash
and is merely used to indicate the interpreter to use for the file. All other lines beginning with #
are absolutely unimportant to bash
, whether the next character is $
or anything else.
Upvotes: 6