![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Help needed please. | jerryboy78 | UNIX for Dummies Questions & Answers | 3 | 03-16-2008 02:06 PM |
| little help needed.. | hilofat | UNIX for Dummies Questions & Answers | 3 | 02-03-2008 11:48 AM |
| Help needed | akhil1460 | UNIX for Dummies Questions & Answers | 1 | 06-18-2006 11:16 PM |
| Help needed | hunter87 | UNIX for Dummies Questions & Answers | 3 | 06-02-2006 12:45 AM |
| Help needed in awk | Vikas Sood | Shell Programming and Scripting | 1 | 05-22-2006 11:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I am trying to write a script that will parse out the e-mail address of a person from the name of a file in a directory.
Example: filename is: /home/myname/first.middle.last@email.com.xls I want to extract just the email address and mail the file to that address. I want to send the first.middle.last@email.com.xls file to first.middle.last@email.com I tried to use awk for this, but I can't seem to get the syntax right. #!/bin/sh curdir="/home/myname" files="$curdir/*.xls" echo " SPREADSHEETS TO BE SENT " >> /home/myname/xls.logfile for filename in $files do echo $filename >> /home/myname/xls.logfile awk ' { print substr( $0, 24, length($0) -4) >> $s } ' $filename echo $s >> /home/myname/xls.logfile done I appreciate all help. |
|
||||
|
That worked! Can you give me a quick explanation of what it is doing? Sorry, I'm pretty new to scripting.
Quote:
|
|
|||||
|
Quote:
Quote:
|
|
|||||
|
Quote:
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|