Reputation: 63
I'm wondering if anyone can help with figure out why my simple bash script is not working, I keep getting:
svn:command not found
even though I have svn installed and it works perfectly outside of my script.
#!/bin/bash
## Get Directory Path From User
printf "\n";
printf "Uses of ~/ or . To Designate Directory Structure Will Not Work!\n"
printf "\n";
printf "Please Enter The FULL Path To The Directory\n"
printf "Where We Shall Create Copy of Slides\n"
read PATH
## If Path Is Valid
if [ -d "$PATH" ]; then
printf "Valid Path To Directory Entered\n"
## Attempt To Copy Files From SVN On Bluenose
`svn checkout https://svn.cs.dal.ca/csci2132/all/slides/ $Path`
printf "All Slides Have Been Copied To "
printf $PATH + "\n"
printf "\n"
## Invalid Path Entered Tell User And Exit
else
printf "Invalid Path Entered\n";
printf "Please Try Again\n";
exit 0;
fi
printf "Task Complete\n"
Upvotes: 3
Views: 11794
Reputation: 212248
The shell looks through the colon separated list of directories in PATH to find executables. Since you have used the name PATH to be the target destination, that is where it is looking for svn. Just choose a different name for the variable. That is, do not overwrite PATH.
Upvotes: 4