![]() |
|
|
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 |
| reading variable value from a file | aixjadoo | Shell Programming and Scripting | 1 | 4 Weeks Ago 05:50 AM |
| Reading a variable from file | shash | UNIX for Dummies Questions & Answers | 6 | 08-06-2009 11:37 AM |
| Reading variable from file variable values | sagii | Shell Programming and Scripting | 5 | 06-27-2009 02:06 PM |
| Reading a file that is already open by another process | Tlg13team | Shell Programming and Scripting | 7 | 08-13-2008 09:57 PM |
| Reading file and assigning that to Variable | Vaddadi | Shell Programming and Scripting | 2 | 04-03-2008 03:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Reading a file with while into variable and using in another process
I would appreciate some help, please.
I have a file cutshellb.txt, which contains four report names (but it could be any number from 1 to x. The report suffix is not necessarily consecutive: report3785 report3786 report3787 report3788 I have a shell script which attempts to read the names and use them as a parameter in another script to run a mail package: Code:
#!/bin/ksh for line in `/usr/bin/cat /u1/cutshellb.txt`; do /u1/sendreportmail.sh MYPRT=$(`echo "$line"`) 1>sendmail.log 2>&1 done Code:
cd /u1/mail/bin/ ./mailsend -i -vvvv -tany_person@mailaddress.uk -s "Mail report " -a/u1/$MYPRT.pdf " " I found this format MYPRT=$(`echo "$line"`) on a website which suggested that there are difficulties with passing variables between parent and child processes with pipes especially within ifs and whiles. Last edited by pludi; 3 Weeks Ago at 01:43 PM.. Reason: code tags, please... |
|
|||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|