Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "#$" mean in bash?

Tags:

syntax

linux

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?

like image 938
E.Cross Avatar asked May 02 '12 15:05

E.Cross


2 Answers

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:

  • http://www.cbi.utsa.edu/sge_tutorial
  • http://web.njit.edu/all_topics/HPC/basement/sge/SGE.html
like image 167
snies Avatar answered Nov 02 '22 10:11

snies


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.

like image 33
sorpigal Avatar answered Nov 02 '22 09:11

sorpigal