I am try to create a symlink using ssh. Here the commands I am using.
cd /home
for homedir in *
do if [ -d ${homedir} ]
ln -s /etc/cpbackup-exclude.conf ${homedir}/cpbackup-exclude.conf
fi
done
After I enter fi I get this error. “-bash: syntax error near unexpected token ‘fi’
I am not sure what is wrong?
Thank you for your help
The syntax of the
ifcommand is:Add keyword
thento your code:BTW, you can indent your code to make it easy to read.