![]() |
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 |
| perl -write values in a file to @array in perl | meghana | Shell Programming and Scripting | 27 | 06-07-2009 05:05 PM |
| SED/AWK Script to clear log file using timestamp? | davesimm | Linux | 2 | 03-03-2008 07:18 AM |
| Clear log file in use. | coolbhai | UNIX for Advanced & Expert Users | 10 | 06-20-2007 09:37 AM |
| How can I clear a line of a file? | Nene | Shell Programming and Scripting | 1 | 08-12-2006 12:03 PM |
| clear memory | fenomen | UNIX for Dummies Questions & Answers | 2 | 06-24-2003 09:33 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
By "clear" I take it you mean that you want to truncate the file to zero size.
In that case... Opening a file for writing (as opposed to appending) means you will overwrite anything in aready in the file, so writing zero-length data to the file leaves you with a zero-length file, wiping out out everything that was there. e.g. Code:
open FH, ">", $filename; print FH; close FH; |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|