-1

something like this, or in the example:

#! /bin/bash

#$ -S abc

I guess '-S' may be a arg to bash, but I am not sure, could anybody give me some reference about this kind of structure?

Thanke you very much.

edit:

sorry about "abc" things (It is a place holder), the main point is what does "#$" mean? How can I use it in a script? By the way, I could not find topics related to these two characters ("#$", also "#$") in stackoverflow, as well as "#!"(shebang), so is there any technology involving here? (escaping? vabatim?)

5
  • Are you sure this is the code? Commented Oct 10, 2016 at 8:40
  • It does nothing, it's a comment. Commented Oct 10, 2016 at 8:42
  • It looks to me like it could be a commented line (#) showing how to run the script. Commented Oct 10, 2016 at 8:42
  • After searching it appears to be syntax for "SunGridEngine". That particular line requests abc as the shell for the job. Commented Oct 10, 2016 at 8:46
  • I have found the original example, thanks to @usr. It is a topic involving SGE, link. I lost the web page... That github page was not maintained for a while, so I decided to ask stackoverflow, thank you very much for you people. Though I am still not sure about what the "#$" means. Commented Oct 11, 2016 at 0:52

2 Answers 2

1

This is probably an option used in job schedulers. From the Sun grid engine manual:

  -S [[hostname]:]pathname,...
          Available for qsub, qsh and qalter.

      Specifies the interpreting shell for the job. Only  one
      pathname  component  without  a host specifier is valid
      and only one path name for a  given  host  is  allowed.
      Shell paths with host assignments define the interpret-
      ing shell for the job if  the  host  is  the  execution
      host. The shell path without host specification is used
      if the execution host matches none of the hosts in  the
      list.

Typically, I have seen it used like:

#!/bin/bash
# Force Grid Engine to use bash shell
#$ -S /bin/bash
...

So, in your case it appears to be using a shell called abc (never heard of it. Probably it's a symlink to some other shell? or you changed your actual example?).

Sign up to request clarification or add additional context in comments.

2 Comments

Sorry about the misleading example. I have changed the example because I could not find the web page I viewed before. The only thing I remember is a -S argument. There are other arguments also. I will find it ASAP.
Yes, "#$" is specified in the "-C prefix_string" section!!
0

Finally, using "SGE -S" in google got this web page: https://uwaterloo.ca/math-faculty-computing-facility/resources/researchers/computing/sun-grid-engine-sge-batch-queuing-system/basic-sun-grid-engine-sge-job

So it appears "#$" is a SGE defined construct, but a bash defined construct. Thanks @usr for the clue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.