What does qsub --cwd `pwd` mean?

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 Answer

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like