E.Cross
E.Cross

Reputation: 2137

What does "#$" mean in bash?

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

Answers (4)

Cippo1987
Cippo1987

Reputation: 59

Those line are important for queue systems like sbatch.

Upvotes: 0

snies
snies

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

KurzedMetal
KurzedMetal

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

sorpigal
sorpigal

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

Related Questions