|
| |||||||||
| Tags: linux, operating system, sed command, shell script, terminal command |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Shell script with sed
Hello I have an amendment to a file and I do not know how to manage the spaces or tabs in a row In short: I try to modify a line that would word1 word2 and word3 separated by spaces or tabs to add mot4 him to finish. Any idea how to accomplish it? Thank you in advance. |
|
#2
| ||||
| ||||
| Re: Shell script with sed
Hi Quote:
Code: sed-i-e 's / ^ \ (arg1. * arg2 \ ).*$/& 1 ADD / g' file.txt |
|
#3
| |||
| |||
| Re: Shell script with sed
Hi Quote:
Code: sed '/ password / s /.*/& Test' system |
|
#4
| ||||
| ||||
| Re: Shell script with sed
Hello Quote:
- From the beginning of line ^ - I put in a buffer inside the expression contained in parentheses: \ (\). Attention is to precede the brackets \. - I'll just end of line .* $ (any character repeated zero ) 2 - & 1 ADD - I copy buffer1: & 1 - And add ADD: ADD when I reread it could even change the order in Code: sed-i-e 's / ^ \ (arg1. * arg2 .* \) $ / & 1 ADD / g' file.txt |
|
#5
| |||
| |||
| Re: Shell script with sed
Hi I want to add the line after the first line that starts with password. I found nothing better than: Quote:
We can not well avoid it? for it does not add as many as there is line beginning with password. |
|
#6
| ||||
| ||||
| Re: Shell script with sed
Hello Quote:
|
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Shell script with sed" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script SSH not working | Lilya | Software Development | 9 | 16-10-2010 02:53 AM |
| Creating shell script in ubuntu | Elizabeth Allen | Operating Systems | 5 | 24-03-2010 02:35 PM |
| Shell script to add the extension to doc and pdf files | Tailor | Software Development | 4 | 24-02-2010 10:51 PM |
| Shell Script Formatting | abhi701 | Software Development | 1 | 04-07-2009 05:30 PM |
| Unix Shell Script | BlackSunReyes | Software Development | 3 | 12-08-2008 02:57 PM |