formatting help needed.
How would i write a script which will add a following content to a file.
File Before running script. Code:
acpi = 1 Code:
acpi = 1 file. There fore if i want to rerun the script with another value it should remove the previous entry and enter the new entry. as below. File Before running script. Code:
acpi = 1 Code:
acpi = 1 therefore seeking your help here. |
How would you have done it in a non-unix scripting environment?
Maybe we can teach you by pointing out the Linux equivalents of whatever you ARE familiar with. Cheers, Tink |
I have tried with following code but still no success . Please help.
Code:
Linenumber=`grep -n "hdc:cdrom" /usr/local/sbin/Test/$VM_GUEST/vm.cfg | cut -f1 -d:` |
Well, your script works for me, provided you previously assign the variable CD_PATH. Do you get some error messages? What is the content of /usr/local/sbin/Test/$VM_GUEST/vm.cfg after running this script?
Anyway, so many passes are not necessary if sed can do it in one line. See the following example (directly on command line): Code:
$ cat file0 |
All times are GMT -5. The time now is 03:42 AM. |