0

I was trying to export some useful paths in .bash_aliases. I figured out independently solution which is also described here.

However this restrict me to switching between the directories. I would like to use that variable also in scripts or just other commands and I do not always want to check whether I have to use quotes around it.

What I am trying to achieve: I have WSL2 installed. I wanted to export my path to OneDrive into a custom variable. Something like this:

export onedrivepath1=/mnt/c/Users/Myuser/OneDrive\ -\ some-domain.at/

I want then use this variable but I do not want always to think about that I need to use "$onedrivepath1".

I want to be able use it like this:

cd $onedrivepath1
cp $onedrivepath1/dir1/test.txt /home/myuser/Documents/ 

Any idea how to achieve this?

Daniel Vavrik
  • 53
  • 1
  • 5

0 Answers0