1

I want to create a script that will create an environment variable that will hold a folder name called "templates". After I create the global variable with the script , I would be able to get to the path of the folder name automatically on the command line, without typing the path again and again.

Can you please suggest ideas.

Thanks,

Mike

  • unclear what you're asking. Can you show us what you want to type at the command line? – glenn jackman Oct 25 '17 at 22:05
  • what's unclear about it? – captcha Oct 25 '17 at 22:10
1

use export for this.

example:

echo "export T=templates" > setvar
. setvar

usage:

cd $T

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.