10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to add a line to a file using sed.
tmp1:
aaaa
Hello
bbbb
Hello
I need to add "testing" after the first match of Hello. So the output should be
aaaa
Hello
testing
bbbb
Hello
and the line to be added will be a variable (2 Replies)
Discussion started by: giri_luck
2 Replies
2. Shell Programming and Scripting
Hello,
I'm trying to figure out how to speed up the following as I want to use multiple commands to search thousands of files.
is there a way to speed things up?
Example I want to search a bunch of files for a specific line, if this line already exists do nothing, if it doesn't exist add it... (4 Replies)
Discussion started by: f77hack
4 Replies
3. Shell Programming and Scripting
Hello.
I want comment or uncomment a ligne in a config file.
The file name : /etc/samba/smb.conf
Normaly the ligne is uncomment :so the line begin with a tab character
followed by passdb backend =\tpassdb backend =
In that case I should comment this line ... (2 Replies)
Discussion started by: jcdole
2 Replies
4. Shell Programming and Scripting
I've been playing with sed, trying to get it to insert the contents of somefile.txt after line 13 on anotherfile.txt. I tried searching for a line with regex and attempting to insert something on the next line with:
find ./anotherfile.txt -type f -exec sed -i -e '/^dog/cat/' {} \;
but it... (2 Replies)
Discussion started by: unclecameron
2 Replies
5. Shell Programming and Scripting
Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated.
script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made.
OS :Susi linux ver 10.3.
... (4 Replies)
Discussion started by: muraliinfy04
4 Replies
6. Shell Programming and Scripting
Hi
In my sed version the interactive method of adding a new works :
> sed '3a\
new line ' file_name
But i want to do the same task in one command as it is a part of a script.
i hav tried the following but no luck so far
cat file_name |sed -e '3a\ new line '
cat file_name |sed -e... (4 Replies)
Discussion started by: ningy
4 Replies
7. Shell Programming and Scripting
Hi,
I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below.
I will be using the config file as mentioned below:
(config.txt)
country:a,b
city:1,2
type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies
8. Shell Programming and Scripting
Hi there, am trying to parse an Apache 'server' config file. A snippet of the config file is shown below:
.....
ProxyPassReverse /foo http://foo.example.com/bar
.....
.....
RewriteRule ^/(.*) http://www.example.com/$1
RewriteRule /redirect https://www.example1.com/$1
........ (7 Replies)
Discussion started by: jy2k7ca
7 Replies
9. Shell Programming and Scripting
Aloha! I have just over 1k of users that have permissions that they shouldn't under our system. I need to parse a provided list of usernames, check their permissions file, and strip the permissions that they are not allowed to have. If upon the permissions strip they are left with no permissions,... (6 Replies)
Discussion started by: Malumake
6 Replies
10. Shell Programming and Scripting
Hi,
I want to add two new lines to a file.
I have:
dn: uid=beele,ou=medewerker,dc=hva,dc=nl
street: Wibautstraat 2-4
dn: uid=beelx,ou=medewerker,dc=hva,dc=nl
street: Wibautstraat 2-4
I want to make:
dn: uid=beele,ou=medewerker,dc=hva,dc=nl
changetype: modify
replace: street
street:... (3 Replies)
Discussion started by: tine
3 Replies