Currently I am trying to have an executable script(script.term) that is located on my flash drive that i can run and it will copy files from my hard drive on my mac to my flash drive with no user interaction.
My first problem is getting system variables to display
The following command doesn't swap out the $HOME and $PWD environment variables:
So i got the idea of trying to use the echo command in combination with the copy command following will just display the text and it will swap out the $HOME and $PWD variables with the values.
Does anyone know how to run the copy command with variables in place.
My second problem
is the $PWD variable doesn't display the location of the flash drive as i thought it would. my second question was is there a variable to detect the location of where the file was executed.
If it helps anyone here is a working solutions in windows command prompt of what i am trying to do
Thanks
My first problem is getting system variables to display
The following command doesn't swap out the $HOME and $PWD environment variables:
Code:
cp -r $HOME/FolderToCopy $PWD/Results
So i got the idea of trying to use the echo command in combination with the copy command following will just display the text and it will swap out the $HOME and $PWD variables with the values.
Code:
echo cp -r $HOME'/FolderToCopy' $PWD'/Results'
Does anyone know how to run the copy command with variables in place.
My second problem
is the $PWD variable doesn't display the location of the flash drive as i thought it would. my second question was is there a variable to detect the location of where the file was executed.
If it helps anyone here is a working solutions in windows command prompt of what i am trying to do
Code:
XCOPY C:\Users\%USERNAME%\FolderToCopy %CD%\Results /F /E /H
Thanks