Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

I'm need to make a batch file that makes every text file in the current directory read only except the one specified in the command prompt. My teacher gave a hint and said use the for command to loop through all the files and use the if not command to check if each file is the one specified. I have no idea how to do this, can anyone help?

OpenStudy (anonymous):

Here is a very simple solution..... INP=$1 echo "Match this: $INP" for x in `ls` do if [ $x != $INP ]; then chmod 444 $x fi done

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!