Sponsored Content
Full Discussion: SED to add a suffix
Top Forums Shell Programming and Scripting SED to add a suffix Post 302390495 by pludi on Thursday 28th of January 2010 05:57:53 AM
Old 01-28-2010
Using the first few lines as example:
Code:
$ cat base.txt
# sshbl.org
# Thu Jan 28 11:45:02 2010 CET
#
# source ip
61.155.177.2
217.120.162.182
60.191.5.181
88.77.54.74
210.21.225.204
174.34.172.133
109.123.74.86
$ awk '!/^#/{print "sshd : "$0" : deny"}' base.txt
sshd : 61.155.177.2 : deny
sshd : 217.120.162.182 : deny
sshd : 60.191.5.181 : deny
sshd : 88.77.54.74 : deny
sshd : 210.21.225.204 : deny
sshd : 174.34.172.133 : deny
sshd : 109.123.74.86 : deny

That ok?
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
avahi.hosts(5)                                                  File Formats Manual                                                 avahi.hosts(5)

NAME
avahi.hosts - avahi-daemon static host name file SYNOPSIS
/etc/avahi/hosts DESCRIPTION
/etc/avahi/hosts is a file which may be used to define static host name to IP address mappings for multicast DNS. This is especially useful when publishing DNS-SD services on behalf of other hosts. See avahi.service(5) for more information. The file format is similar to the one of /etc/hosts: on each line an IP address and the corresponding host name. The host names should be in FQDN form, i.e. with appended .local suffix. AUTHORS
The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from http://avahi.org/ SEE ALSO
avahi-daemon(8), avahi.service(5) COMMENTS
This man page was written using xml2man(1) by Oliver Kurth. Manuals User avahi.hosts(5)
All times are GMT -4. The time now is 02:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy