Sponsored Content
Top Forums UNIX for Dummies Questions & Answers To delete content of many file Post 11649 by rwb1959 on Monday 10th of December 2001 11:23:14 AM
Old 12-10-2001
You can also just do...

> filename

...which truncates an existing file or creates a new
"empty" file
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I need to delete the content out of a number of logs

I'm just starting out in scripting (taking online classes) but I need to know how to clean out (delete) the content of a number of logs. All of the files end in 'trc'. Does anyone have a script or command (SED or AWK) I can use? Julie (4 Replies)
Discussion started by: Jbolin01
4 Replies

2. Shell Programming and Scripting

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/data/PLAT/MIMUS/upload/PROD/archive/112042708173000.txt /home/krishnaveni/scripts/tempFolder` #echo... (5 Replies)
Discussion started by: kittusri9
5 Replies

3. Shell Programming and Scripting

Delete content of file 1 in file 2 with shell script

OK, best is I explain what the operating enviroment is. Linux, but Motomagx. It is a Linux operated mobile phone, Motorola V8. I am writting a shell script, but got stuck. I have to delete the complete content of file 1 in file 2. I have attached the 2 files. You can see that the content of... (2 Replies)
Discussion started by: rasputin007
2 Replies

4. Shell Programming and Scripting

how to delete special characters from the file content

Hello Team, Any one suggest how to delte the below special character from a file which is having one column 10 rows of same below content. ---------------------------------------- Kosten|bersicht gemd_ ' =Welche Kosten kvnnen... (2 Replies)
Discussion started by: kanakaraju
2 Replies

5. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

6. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

7. Shell Programming and Scripting

Delete file content by asking user Yes/No...

I have following script to ping multiple ips but i want to delete ip.csv file content after running script .....but before deleting content i have ask user yes/No prompt depend on user input Yes/no ip.csv content will delete.. #!/bin/bash for enodeb in `cat /tmp/ip.csv` do ping -c 2... (3 Replies)
Discussion started by: Ganesh Mankar
3 Replies

8. Shell Programming and Scripting

awk to delete content before and after a matched pattern

Hello, I have been trying to write a script where I could get awk to delete data before and after a matched pattern. For eg Raw data Start NAME = John Age = 35 Occupation = Programmer City = New York Certification Completed = No Salary = 80000 End Start NAME = Mary Age = 25... (2 Replies)
Discussion started by: sidnow
2 Replies

9. UNIX for Beginners Questions & Answers

AIX Delete all mbox content

Hi, How to Delete all mbox content in AIX? Thanks. (2 Replies)
Discussion started by: big123456
2 Replies
DBM(3X) 																   DBM(3X)

NAME
dbminit, fetch, store, delete, firstkey, nextkey - data base subroutines SYNOPSIS
typedef struct { char *dptr; int dsize; } datum; dbminit(file) char *file; datum fetch(key) datum key; store(key, content) datum key, content; delete(key) datum key; datum firstkey(); datum nextkey(key); datum key; DESCRIPTION
These functions maintain key/content pairs in a data base. The functions will handle very large (a billion blocks) databases and will access a keyed item in one or two filesystem accesses. The functions are obtained with the loader option -ldbm. Keys and contents are described by the datum typedef. A datum specifies a string of dsize bytes pointed to by dptr. Arbitrary binary data, as well as normal ASCII strings, are allowed. The data base is stored in two files. One file is a directory containing a bit map and has `.dir' as its suffix. The second file contains all data and has `.pag' as its suffix. Before a database can be accessed, it must be opened by dbminit. At the time of this call, the files file.dir and file.pag must exist. (An empty database is created by creating zero-length `.dir' and `.pag' files.) Once open, the data stored under a key is accessed by fetch and data is placed under a key by store. A key (and its associated contents) is deleted by delete. A linear pass through all keys in a database may be made, in an (apparently) random order, by use of firstkey and nextkey. Firstkey will return the first key in the database. With any key nextkey will return the next key in the database. This code will traverse the data base: for(key=firstkey(); key.dptr!=NULL; key=nextkey(key)) DIAGNOSTICS
All functions that return an int indicate errors with negative values. A zero return indicates ok. Routines that return a datum indicate errors with a null(0) dptr. BUGS
The `.pag' file will contain holes so that its apparent size is about four times its actual content. Older UNIX systems may create real file blocks for these holes when touched. These files cannot be copied by normal means (cp, cat, tp, tar, ar) without filling in the holes. Dptr pointers returned by these subroutines point into static storage that is changed by subsequent calls. The sum of the sizes of a key/content pair must not exceed the internal block size (currently 512 bytes). Moreover all key/content pairs that hash together must fit on a single block. Store will return an error in the event that a disk block fills with inseparable data. Delete does not physically reclaim file space, although it does make it available for reuse. The order of keys presented by firstkey and nextkey depends on a hashing function, not on anything interesting. DBM(3X)
All times are GMT -4. The time now is 03:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy