Sponsored Content
Top Forums UNIX for Advanced & Expert Users Put strings around the file name Post 302116858 by Jolly on Wednesday 9th of May 2007 05:12:45 AM
Old 05-09-2007
Question Put strings around the file name

I have a file(old file) with names in it like
Jolly Mirani
Han Lee
stuart Lloyd

I want string to be added to these names . New file should look like
'jolly mirani'
'han lee'
'stuart lloyd'

I tried using sed command but doesn't work for string but it do work for paranthesis. Can some one help me with the code for the same.

sed 's/[^][^]*/(&)/g' <old file> new file
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Take a file from the system and put on tape and reset the file to 0 bytes

:mad: I did this the other day but one of my support personnel removed my history so i could call it back up to remeber the exact command since i am air-headed at times. I am trying to take a 30 MEG file off the system and drop it to tape then i want to make the file go back to being 0 bytes so... (1 Reply)
Discussion started by: JackieRyan26
1 Replies

2. Shell Programming and Scripting

Grep strings from file and put in Column

Dear Experts, My file contains below- GET:SUB:ISI,432350414557432; RESP:0:MD,019352020633:ISI,432350414557432:T11,1:T21,1:T22,1:B16,1:T62,1:BAIC,0:BAOC,1:BOIC,0:BIRO,0:BORO,0:PAID,1; GET:SUB:ISI,432350414581060;... (2 Replies)
Discussion started by: thepurple
2 Replies

3. UNIX for Dummies Questions & Answers

I want some selected data from first file and put into other file in specified format

I have a file with follwing content ---------------------------------- SCHEDULE XXXXXXXXX#JOBCOUNT ON EVERYDAY AT 0000 PRIORITY 50 SCHEDULE XXXXXXXXX#ABCDEFGH ON EVERYDAY AT 0001 PRIORITY 29 SCHEDULE... (5 Replies)
Discussion started by: shreyas
5 Replies

4. Shell Programming and Scripting

split input data file and put into same output file

Hi All, I have two input file and need to generate a CSV file. The existing report just "GREP" the records with the Header and Tailer records with the count of records. Now i need to split the data into 25 records each in the same CSV file. id_file (Input file ) 227050994 232510151... (4 Replies)
Discussion started by: rasmith
4 Replies

5. Shell Programming and Scripting

Delete lines in file containing duplicate strings, keeping longer strings

The question is not as simple as the title... I have a file, it looks like this <string name="string1">RZ-LED</string> <string name="string2">2.0</string> <string name="string2">Version 2.0</string> <string name="string3">BP</string> I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies

6. Shell Programming and Scripting

how to read strings from a txt and put them into a spreadsheet?

i have hundreds of thousands of txt files as below, RADARSAT 1 SCENE DESCRIPTION SCENE_ID c0005098 MDA ORDER NUMBER GEOGRAPHICAL AREA CIS ScanSar Canada SCENE START TIME APR 02 1997 23:05:10.222 SCENE STOP TIME APR 02 1997 23:02:49.695... (5 Replies)
Discussion started by: sunnydanniel
5 Replies

7. Shell Programming and Scripting

Extract two strings from a file and create a new file with these strings

I have the following lines in a log file. It would be great if some one can help me to create a new file with the just entries in the below format. 66.150.161.195 HPSAC=Z05 66.150.161.196 HPSAC=A05 That is just extract the IP address and the string DPSAC=its value 66.150.161.195 -... (1 Reply)
Discussion started by: Tuxidow
1 Replies

8. UNIX for Beginners Questions & Answers

How to pass strings from a list of strings from another file and create multiple files?

Hello Everyone , Iam a newbie to shell programming and iam reaching out if anyone can help in this :- I have two files 1) Insert.txt 2) partition_list.txt insert.txt looks like this :- insert into emp1 partition (partition_name) (a1, b2, c4, s6, d8) select a1, b2, c4, (2 Replies)
Discussion started by: nubie2linux
2 Replies

9. UNIX for Beginners Questions & Answers

Use strings from nth field from one file to match strings in entire line in another file, awk

I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file. I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies

10. UNIX for Beginners Questions & Answers

(g)awk: Matching strings from one file in another file between two strings

Hello all, I can get close to what I am looking for but cannot seem to hit it exactly and was wondering if I could get your help. I have the following sample from textfile with many thousands of lines: File 1 PS001,001 HLK PS002,004 L<G PS004,002 XNN PS004,006 BVX PS004,006 ZBX=... (7 Replies)
Discussion started by: jvoot
7 Replies
SHOREWALL6-TCDEVICE(5)						  [FIXME: manual]					    SHOREWALL6-TCDEVICE(5)

NAME
tcdevices - Shorewall6 Traffic Shaping Devices file SYNOPSIS
/etc/shorewall6/tcdevices DESCRIPTION
Entries in this file define the bandwidth for interfaces on which you want traffic shaping to be enabled. If you do not plan to use traffic shaping for a device, don't put it in here as it limits the throughput of that device to the limits you set here. A note on the bandwidth definitions used in this file: o don't use a space between the integer value and the unit: 30kbit is valid while 30 kbit is not. o you can use one of the following units: kbps Kilobytes per second. mbps Megabytes per second. kbit Kilobits per second. mbit Megabits per second. bps or number Bytes per second. o Only whole integers are allowed. The columns in the file are as follows (where the column name is followed by a different name in parentheses, the different name is used in the alternate specification syntax). INTERFACE - [number:]interface Name of interface. Each interface may be listed only once in this file. You may NOT specify the name of an alias (e.g., eth0:0) here; see http://www.shorewall.net/FAQ.htm#faq18 You may NOT specify wildcards here, e.g. if you have multiple ppp interfaces, you need to put them all in here! If the device doesn't exist, a warning message will be issued during "shorewall6 [re]start" and "shorewall6 refresh" and traffic shaping configuration will be skipped for that device. Shorewall6 assigns a sequential interface number to each interface (the first entry in the file is interface 1, the second is interface 2 and so on) Beginning with Shorewall6-perl 4.1.6, you can explicitly specify the interface number by prefixing the interface name with the number and a colon (":"). Example: 1:eth0. IN-BANDWIDTH (in_bandwidth) - {-|bandwidth[:burst]|~bandwidth[:interval:decay_interval]} The incoming bandwidth of that interface. Please note that you are not able to do traffic shaping on incoming traffic, as the traffic is already received before you could do so. But this allows you to define the maximum traffic allowed for this interface in total, if the rate is exceeded, the packets are dropped. You want this mainly if you have a DSL or Cable connection to avoid queuing at your providers side. If you don't want any traffic to be dropped, set this to a value to zero in which case Shorewall will not create an ingress qdisc.Must be set to zero if the REDIRECTED INTERFACES column is non-empty. The optional burst option was added in Shorewall 4.4.18. The default burst is 10kb. A larger burst can help make the bandwidth more accurate; often for fast lines, the enforced rate is well below the specified bandwidth. What is described above creates a rate/burst policing filter. Beginning with Shorewall 4.4.25, a rate-estimated policing filter may be configured instead. Rate-estimated filters should be used with ethernet adapters that have Generic Receive Offload enabled by default. See Shorewall FAQ 97a[1]. To create a rate-estimated filter, precede the bandwidth with a tilde ("~"). The optional interval and decay_interval determine how often the rate is estimated and how many samples are retained for estimating. Please see http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt for details. OUT-BANDWIDTH (out_bandwidth) - bandwidth The outgoing bandwidth of that interface. This is the maximum speed your connection can handle. It is also the speed you can refer as "full" if you define the tc classes in shorewall6-tcclasses[2](5). Outgoing traffic above this rate will be dropped. OPTIONS - {-|{classify|hfsc} ,...} classify -- When specified, Shorewall will not generate tc or Netfilter rules to classify traffic based on packet marks. You must do all classification using CLASSIFY rules in shorewall-tcrules[3](5). hfsc - Shorewall normally uses the Hierarchical Token Bucket queuing discipline. When hfsc is specified, the Hierarchical Fair Service Curves discipline is used instead. REDIRECTED INTERFACES (redirect) - [interface[,interface]...] Added in Shorewall6-perl 4.1.6. May only be specified if the interface in the INTERFACE column is an Intermediate Frame Block (IFB) device. Causes packets that enter each listed interface to be passed through the egress filters defined for this device, thus providing a form of incoming traffic shaping. When this column is non-empty, the classify option is assumed. EXAMPLES
Example 1: Suppose you are using PPP over Ethernet (DSL) and ppp0 is the interface for this. The device has an outgoing bandwidth of 500kbit and an incoming bandwidth of 6000kbit #INTERFACE IN-BANDWIDTH OUT-BANDWIDTH OPTIONS REDIRECTED # INTERFACES 1:ppp0 6000kbit 500kbit FILES
/etc/shorewall6/tcdevices SEE ALSO
http://shorewall.net/traffic_shaping.htm http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt shorewall6(8), shorewall6-accounting(5), shorewall6-actions(5), shorewall6-blacklist(5), shorewall6-hosts(5), shorewall6-interfaces(5), shorewall6-maclist(5), shoewall6-netmap(5),shorewall6-params(5), shorewall6-policy(5), shorewall6-providers(5), shorewall6-rtrules(5), shorewall6-routestopped(5), shorewall6-rules(5), shorewall6.conf(5), shorewall6-secmarks(5), shorewall6-tcclasses(5), shorewall6-tcrules(5), shorewall6-tos(5), shorewall6-tunnels(5), shorewall6-zones(5) NOTES
1. Shorewall FAQ 97a http://www.shorewall.net/FAQ.htm#faq97a 2. shorewall6-tcclasses http://www.shorewall.net/manpages6/shorewall6-tcclasses.html 3. shorewall-tcrules http://www.shorewall.net/manpages6/shorewall-tcrules.html [FIXME: source] 06/28/2012 SHOREWALL6-TCDEVICE(5)
All times are GMT -4. The time now is 03:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy