So i am trying to learn how to write scripts for Linux OS's so I wrote this download and install script. Although, I know that any good coder for linux would think this is absolute skid work, It works up to par so far so I just have one error at the moment.
CODE:
#!/bin/sh
###################################
#Lystics Core Linux Code v1 #
# #
# Starting Date 4/14 #
# #
# Ending Date ~ #
# #
###################################
clear
#Define Veriables
dir='./LysticsCode/'
url='http://lysticscode.host-elite.com/Linux/Bash%20Scripts/LCode.sh'
file=$(basename "$url")
echo LysticsCode for Linux v1 Installer
echo
read -r -p "Are you sure you wish to install? [Y/n] " a
if [ "$a" = 'n' -o "$a" = 'N' ]; then
#Not going to install
echo 'Exiting The Installation. Thank You! =D'
exit 1;
else
#Set up screen
clear
echo LysticsCode for Linux v1
echo First Installation
echo ''
#Installing
echo Downloading Packages...
curl -o "$dir$file" "$url"
echo ''
echo ''
echo 'Download Complete!'
eval "alias lcode=/root/LysticsCode/Main.sh"
exit 1;
fi
#End Script
$SHELL
What I am trying to do is add a command alias that will allow the installed files to be accessed much easier. I tried using eval "alias lcode=DIR" and it did not work. Same with $(alias lcode=dir)
Can anyone Help?