SED to add a suffix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SED to add a suffix
# 8  
Old 01-29-2010
We're not closing down threads unless they've been silent for a certain amount of time, or the contents violate our rules. You might have you answer, but someone else might add something, that another might find useful.
# 9  
Old 01-29-2010
Ah ok, no problem :-)
Didn't know that.
# 10  
Old 01-29-2010
Quote:
Originally Posted by necron
Exactemundo!
[/COLOR]In case anyone cares, I added a different output, since the above command did the output to stdout instead of a file.
You can try sed -i to get update in the file directly.

Code:
sed  -i.bak 's/\(^[0-9].*\)/sshd : \1 : deny/'   /tmp/base.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Prefix/Suffix on same file

Hi, I want to add prefix and suffix on line# 205 using SED or AWK and want to change on the same file without creating new file. This command will be used in the bash script Am using Bash shell Regards Nayaj (3 Replies)
Discussion started by: Nayaj
3 Replies

2. Shell Programming and Scripting

Suffix formatting with awk

i would like to format the 9 character with suffix as "0". i tried below it doesn't work. >a=12345 > echo $a | awk '{printf "%-09s\n",$1}' >12345 required output is 123450000 can you guys help me out ? (7 Replies)
Discussion started by: expert
7 Replies

3. Shell Programming and Scripting

Rsync script to rewrite suffix - BASH, awk, sed, perl?

trying to write up a script to put the suffix back. heres what I have but can't get it to do anything :( would like it to be name.date.suffix rsync -zrlpoDtub --suffix=".`date +%Y%m%d%k%M%S`.~" --bwlimit=1024 /mymounts/test1/ /mymounts/test2/ while IFS=. read -r -u 9 -d '' name... (1 Reply)
Discussion started by: jmituzas
1 Replies

4. Shell Programming and Scripting

Column content match and add suffix

My input chr3 galGal3_xenoRefFlat CDS 4178235 4178264 0.000000 + 0 gene_id "T6J4.19; T6J4_19"; transcript_id "T6J4.19; T6J4_19"; chr3 galGal3_xenoRefFlat exon 4178235 4178264 0.000000 + . gene_id "T6J4.19; T6J4_19"; transcript_id "T6J4.19;... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

5. Shell Programming and Scripting

Arguments and suffix name

While calling shell script i need to use prefix . Any idea? Ex: myscript.sh -parameter1 "AA;BB" -parameter2 "DD;E" (5 Replies)
Discussion started by: mnjx
5 Replies

6. Shell Programming and Scripting

suffix a sequence in awk

hi I have a string pattern like ... ... 000446448742 00432265 040520100408 21974435 DEWSWATER GARRIER AAG IK4000 N 017500180000000000000000077000000000100 000446448742 00580937 040520100408 32083576 PEWSWATER BARRIER DAG GK4000 ... (6 Replies)
Discussion started by: zainravi
6 Replies

7. Shell Programming and Scripting

Removing domain suffix with SED

Hi Experts, I have a syslog file from 1000's of different hosts which I want to adjust by removing the domain suffix from the hosts. My previous attempts haven't managed to match all the different lenghts of the subdomains which are being logged. Could somebody suggest which sed syntax... (6 Replies)
Discussion started by: krypton
6 Replies

8. Shell Programming and Scripting

how to find files not suffix with .c

if I want to search those files which were suffix with .c, I can use find ./ -name *.c but how to find out those files which were not suffix with .c ?? Thanks a lot! (2 Replies)
Discussion started by: cqlouis
2 Replies

9. Shell Programming and Scripting

csplit suffix-format: how to?

I am using GNU csplit to extract chapters from a big file into smaller files. I want to use the -b option -b, --suffix-format=FORMAT use sprintf FORMAT instead of %d but I have failed so far. 1) All the generated files need to have a suffix .txt at the end 2) They have to look like... (1 Reply)
Discussion started by: MarioColuzzi
1 Replies

10. Shell Programming and Scripting

prefix suffix to each argument

Hi, I have a variable, which contains comma separated values. Something like. StringA="abc,def,ghi,jkl" I want to apply prefix and suffix to each value in the string without using any loops. Say if Prefix is Pre_ and Suffix is _Suf then I need to get ... (1 Reply)
Discussion started by: tostay2003
1 Replies
Login or Register to Ask a Question