0

I have to submit a script for slurm. I should enter the directory path whenever I change the submit script path. for example if I am in folder1 I should write manually:

/home/job/folder1

if I want to use the script in folder2 I should write:

/home/job/folder2 

Is there any command to avoid making this change manually?

PS: I know I can use $pwd but I did not find the right way.

1 Answer 1

0

With $PWD

  • PWD is an environment variable that is updated to contain the current directory,
  • $variable is replaced by the value of variable

This gives:

thescript $PWD

With $(pwd)

  • pwd is a command that prints the current directory
  • $(command) is replaced by the output of command

This gives:

thescript $(pwd)
1
  • @PRATAP No, as explained, they are two different things.
    – xenoid
    Oct 13, 2019 at 16:49

You must log in to answer this question.

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