Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting "svn: command not found"

Tags:

linux

bash

unix

svn

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"
like image 512
user3277807 Avatar asked Jan 21 '26 15:01

user3277807


1 Answers

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.

like image 130
William Pursell Avatar answered Jan 24 '26 08:01

William Pursell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!