While executing the below script, I'm getting an error:
Syntax error at line 1 : `(' is not expected.
sudo su - user1 -c "cd $HOME ; tar -cvf $HOME/mine.tar `cat /tmp/$LOGNAME/List` "
where List file contains the name of some other files.
Please help me out with some solution.
Regards, Sumit
sudo su - user1 -c date
? How aboutsudo su - user1 -c sh
and then typecd $HOME ; tar -cvf $HOME/mine.tar `cat /tmp/$LOGNAME/List`
into the shell?cd $HOME
? You already have an-f $HOME/mine.tar
in the command.