![]() |
|
|
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 |
| mail: no space for temp file | usernamea | UNIX and Linux Applications | 3 | 10-02-2008 02:58 PM |
| Script to Delete temp files and check file system | Bwood1377 | Shell Programming and Scripting | 3 | 08-14-2008 09:34 AM |
| Append to end of each line of file without a temp file. | rorey_breaker | Shell Programming and Scripting | 4 | 04-03-2008 11:11 AM |
| Avoid Duplicates in a file | pssandeep | UNIX for Dummies Questions & Answers | 7 | 03-26-2008 06:36 AM |
| Probably an easy SMIT question- "Unable to open temp file" | jeffpas | AIX | 6 | 02-29-2008 06:06 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to avoid a temp file
Hi all.
I want to check the free space on a given FS and process the output. Right now, I'm using a temp file to avoid using df twice. This is what I'm doing #!/usr/bin/ksh ... df -k $FS_NAME > $TMP_FILE 2>&1 if [[ $? -ne 0 ]]; then RESULT="CRITICAL - $(cat $TMP_FILE)" else cat $TMP_FILE | ... fi rm $TMP_FILE So, I store the result in a temp file, with the advantage of being able to store both sysout and syserr results I can later use as an output to the script. However, I don't like having to use a temp file. So, is there some way to do the same without the temp file? Basically I want to:
If I just use a variable, as in A=$(...), I can't get the syserr, and I lose the carriage returns. Any ideas? Thank you. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|