Skip to content
Snippets Groups Projects
T2.sh 342 B
Newer Older
antux18's avatar
antux18 committed
#!/bin/bash
antux18's avatar
antux18 committed
#the following command returns the number of arguments
#hint $? will be 0 if there are no errors after any bash command
antux18's avatar
antux18 committed

antux18's avatar
antux18 committed
args=$#
if [ $args -lt 2 ]
then
	echo Usage sh T2.sh folder_path link.
	exit
fi
folder_path=$1
link=$2
antux18's avatar
antux18 committed

mkdir $folder_path
if [ $? -eq 1 ]
then
	exit
fi

ln -s $folder_path $link
if [ $? -eq 1 ]
then
	exit
fi