1

I am newbie to Linux command lines. I just got a queue submission command from others. The command line is as follows:

qsub --cwd `pwd` -t 60 -n 1 --proccount 1 --mode c1 --env LD_LIBRARY_PATH=${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy:WM_PROJECT_DIR=${WM_PROJECT_DIR} ${FOAM_APPBIN}/blockMesh

I didn't quite understand the --cwd `pwd` part. I know the following parameters are related to time, nodes, processors and executable file. Can anyone help explain what --cwd `pwd` means?

2
  • 1
    what does man qsub say? May 19, 2015 at 21:56
  • --cmd 'pwd' is for running the command pwd (present working directory) and the qsub itself as a command is a script configuration / run at tool May 19, 2015 at 23:21

1 Answer 1

3

It's probably telling qsub to execute the command in the current working directory.

pwd is the shell command "print working directory", which just reports what your current working directory is. Putting that command in `backticks` tells the shell to execute that command in a sub-shell and insert its output into the command line in that place. So if you were currently in /home/jerry when you typed in the qsub command line, the command line would become qsub --cwd /home/jerry.

In some versions of qsub, there's a -cwd option that doesn't take an argument, and just always tells qsub to execute the command in the current working directory. It looks like your version of qsub has a --cwd option that can take an argument, and perhaps uses that argument as the path to "cd into" (i.e. set as its working directory) before executing the command. Or maybe your system's qsub doesn't really work that way, but whoever gave you that command mistakenly thought it worked that way.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .