The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
find content from a file ust Shell Programming and Scripting 7 11-30-2007 06:36 AM
Content of Content of a variable! jaduks Shell Programming and Scripting 2 08-27-2007 12:40 AM
Using the content of a file in the name of another anriot Shell Programming and Scripting 2 09-18-2006 07:56 PM
I need to delete the content out of a number of logs Jbolin01 Shell Programming and Scripting 4 09-30-2003 09:28 AM
To delete content of many file athresh UNIX for Dummies Questions & Answers 4 12-10-2001 04:34 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2008
kittusri9 kittusri9 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 40
Arrow how to delete content in a file (delete content only)

Hi Friends

I have a file called processLog.txt file

processLog.txt
---------------
echo "line starts "$LINE
suppCode=${LINE:0:3}
#gatewayArchive=`scp root@mrp-gateway:/usr/local/apache/d...2708173000.txt /home/krishnaveni/scripts/tempFolder`
#echo "gateway files :"$gatewayArchive
#file1=$suppCode$DtTime"*.txt"
file1="112042708173000.txt"
echo "file1 :"$file1
#
# checking files in sftp server
#
find_sftp_files $file1
--------------------------

once my task has done
just i need to delete content of that log file

i need to delete only content not file
is it possible
please help me from this problem

Thanks
Krish.
  #2 (permalink)  
Old 05-15-2008
alamitab alamitab is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 25
cat /dev/null > processLog.txt
  #3 (permalink)  
Old 05-15-2008
kittusri9 kittusri9 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 40
Thank you so much
it helpmed a lottttttt........
  #4 (permalink)  
Old 05-15-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,419
Shorter
Code:
echo > file.name
  #5 (permalink)  
Old 05-15-2008
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
Or
Code:
>file.name
  #6 (permalink)  
Old 05-15-2008
Dave Miller's Avatar
Dave Miller Dave Miller is offline
Registered User
  
 

Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 151
Quote:
Originally Posted by alamitab View Post
cat /dev/null > processLog.txt
Quote:
Originally Posted by Klashxx View Post
> file.name
Both of those produce empty files.


Quote:
Originally Posted by danmero View Post
echo > file.name
This produces a file with one character.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0