![]() |
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 |
| Debian: New policyd-weight packages fix insecure temporary files | iBot | Security Advisories (RSS) | 0 | 03-27-2008 02:50 PM |
| remove temporary file ? | varungupta | Shell Programming and Scripting | 5 | 11-23-2007 03:50 AM |
| Avoid creating temporary files on editing a file in Ubuntu | royalibrahim | Ubuntu | 7 | 11-17-2007 05:57 AM |
| Removing temporary alias | veccinho | AIX | 1 | 09-04-2007 05:19 AM |
| solve temporary root password | go3mon | Shell Programming and Scripting | 1 | 06-23-2005 08:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Temporary files and rm
Hello everyone,
I am creating a temporary file in my ksh by using something file filetemp=filetemp.$$ Later on in my script I write to the file $filetemp by 'cat'ing to it. Then in the script I am doing a 'less' on the file to view it. At the end of the script I issue a rm $filetemp 2> /dev/null . I am experiencing an issue that I would like to have explained. Most of the times the file is deleted properly. Once in a while, though, the file is still there after I exit my script. I cannot tell if it is related to the file being large or small or if it is tied to the amount of time the file stays open under the 'less' command. Any ideas? Maybe there is a better way to deal with temp files? Any suggestions or advice will be greatly appreciated. Thanks. |
|
||||
|
Well, the first thing you should do is change 'rm $filetemp 2> /dev/null' to 'rm $filetemp 2> somefile' so you can capture the error message and interrogate what rm is producing in order to find out why it is not removing the file. This may give you a clue as to what is happenning.
Sam |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|