String replace in shell script
Hi Friends and Guru's
I need to replace a string in my script.. my sample file : root# cat passwd ################################ This is script generated file tftp = off dns = off my script: #!/bin/sh cat /nir/passwd | grep tftp >/dev/null RC=$? if [ "$RC" = 0 ] ; then echo "Tftp is exist" RM=`cat /nir/passwd | grep tftp | awk '{print$3}'` if [ $RM = off ] ; then echo "Fail: TFTP is : $RM: Do you want to make it : ON" else echo " TFTP is | ON......exiting" fi fi in my sample its showing tftp = off and it should to modified to tftp = on. any help is appreciateable Thanks In Advance JNReddy |
Here's one solution... the answer you seek is in bold text.
Code:
#!/bin/bash |
Hats off
Hi dwhitney67,
Thanks a Lot it's an excellent script, it solved my task.... Thanks a lot... Thanks JNReddy |
Please mark as SOLVED once you have a solution
|
All times are GMT -5. The time now is 03:42 AM. |