[SOLVED] scripts syntax questions
Posted: 30 Oct 2015, 10:19
Hi
Looking into the /var/log/scripts I noticed most seem to use a formula that looks like this
I am pretty sure, we must be at / to do this as there is no prefix / as in /usr/lib64
question 1
Can I use this command and get away with it?
Or is there some rule, that ( x ) must be all on one line?
question 2
If not, is this acceptable
I am not a great coder so if I have missed something or you have better suggestions please feel free to enlighten me.
I want to get something right before attempting to post something for a new module.
Thanks for reading
Looking into the /var/log/scripts I noticed most seem to use a formula that looks like this
where command is something like linking, removing etc.( cd usr/lib64 ; <command> )
I am pretty sure, we must be at / to do this as there is no prefix / as in /usr/lib64
question 1
Can I use this command and get away with it?
Code: Select all
( cd usr/lib64 ; rm -rf file1 file2
if [ -f file3 ] ; then rm -rf file3 fi )
question 2
If not, is this acceptable
Code: Select all
cd /usr/lib64
rm -rf file1 file2
if [ -f file3 ] ; then rm -rf file3 fi
cd /
I want to get something right before attempting to post something for a new module.
Thanks for reading