What is the correct way to save the current directory to a variable?

What is the correct way to save the current directory to a variable?Category: Linux EssentialsWhat is the correct way to save the current directory to a variable?
Linux Questions Staff asked 1 year ago

What is the correct way to save the current directory to a variable?

  • A=`pwd`
  • A=pwd
  • A=cwd
  • pwd $A
  • pwd | $A

About the author