Putty Please Give Commands Way Insert Commands Putty Create Following Script Joker2sh Run Q37179041

All this I have to do through PUTTY. Please give me commandsthat way I can insert these commands into PUTTY.

Create the following script,joker2.sh, and run the test commands above (use joker3.sh insteadof joker.sh). In this example, grep $1 /etc/passwd sets the valueof $? to 0 (true) if the pattern is matched and sets $? to 1(false) if the pattern is not matched. if then acts on the value of$?.

#!/bin/sh

#

if grep $1 /etc/passwd

then

      echo“Pattern found – Exiting Now!”

exit 0 else

      echo“Pattern not found – Job Over!”

      exit1

fi


Answer


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.