![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| make multiple line containing a pattern into single line | VTAWKVT | Shell Programming and Scripting | 13 | 12-04-2008 06:40 PM |
| single line input to multiple line output with sed | mitch | Shell Programming and Scripting | 8 | 07-16-2008 02:57 PM |
| Adding a word in front of a word of each line. | Ramesh Vellanki | Shell Programming and Scripting | 4 | 07-02-2008 10:17 AM |
| replacing multiple lines with single line | siba.s.nayak | Shell Programming and Scripting | 3 | 05-28-2008 03:43 AM |
| Splitting a single line into multiple lines | thanuman | Shell Programming and Scripting | 4 | 02-23-2005 04:56 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I have following problem.
<File A> contains let say 5 lines but can be changed. cat dog fish car if I want to add word to each line then how do I go about it? I used paste -d but that requires two files having same number of lines but in my case <File A> changes and I just need to add one word to line from <File A> but lines change depend on data. thanks |
|
||||
|
I've used two different files. file1 contain my reports to managers and second file contain our email domain. Unfortunately, not all the time same number of usres receive the file. so file2 contain domain should just be one word ( mycompany.com ) to be attached to file1 that containing links to webserver for their own individual reporsts
paste -d' ' /usr/local/squid/compweb/tmptxt/4div82indi4httplinks.txt /usr/local/squid/compweb/tmptxt/divemail.txt > /usr/local/squid/compweb/ tmptxt/5div82indireport.txt but above script only works when both files contain same number of lines. so I just need to add company domainname (i.e: mycompany.com ) to first link which has link and manager email name. thank you |
|
||||
|
basically
nawk -F"," '{printf("echo %s | mail -s \"Corporate \- Weekly Internet Usage Report\"\n",$1)}' < /usr/local/squid/websever/tmptxt/3div82reportlinks.txt > /usr/local/squid/webserver/tmptxt/4div82indi4httplinks.txt will create echo http://webserverfw:8081/squid-report...doe/index.html | mail -s "Corporate - Weekly Internet Usage Report " jdoe so some how I just need to add @mycompany.com at the end of "jdoe" to make it into "jdoe@mycompany.com" so it can fire off email to the managers. Not sure how to twick above script to add "@mycompany.com" as part of script. |
|
|||||
|
Not exataly what your looking for but might help you... list.txt: jim john bill mary Code:
awk '{ print $1"@some.com"}' list.txt
OUTPUT: jim@some.com john@some.com bill@some.com mary@some.com |
|
||||
|
Quote:
![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|