![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search files with specfic extention and later search content | lovi_v | UNIX for Advanced & Expert Users | 2 | 07-14-2008 12:05 PM |
| how to delete content in a file (delete content only) | kittusri9 | Shell Programming and Scripting | 5 | 05-15-2008 01:12 PM |
| shell script to search content of file with timestamps in the directory | psychobeauty | Shell Programming and Scripting | 10 | 04-21-2008 05:37 AM |
| shell script to edit the content of a file | tiger99 | Shell Programming and Scripting | 3 | 01-31-2008 04:43 AM |
| Urgent: selecting unique specific content of a file using shell script | jisha | Shell Programming and Scripting | 2 | 01-08-2008 08:45 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
shell script to search a string and delete the content
Hi,
I've a shell script e.g. #!/bin/bash echo "Enter the next hop id" read nhid echo "enter the IP address" read IP echo "enter the interface name" read name echo "enter the enable/disable state" read state exit 0 now from this script i want to search strings in another (.cam) file e.g. the cam file is BEGIN next hop id value nhid IP address value 192.168.1.101 Interface name xyz enable disable state 1 END now i've to search for the string 'next hop id value' in this cam file then delete the values in front of this string untill a new line starts and then append the user input value stored in the variable in front of this string. similarly for other fields. like if previously the cam file is as above and the user input value for ip address is 111.111.111.111, interface name is abc and enable/disable state is 0. finally this cam file should become like this: BEGIN next hop id value nhid IP address value 111.111.111.111 Interface name abc enable disable state 0 END can anyone help me out in this..... Thanks in advance!! Vikas |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|