automatically removing a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting automatically removing a file
# 1  
Old 02-19-2009
automatically removing a file

Hello,

Is there a script that i could write to automatically delete a file everytime that it is created (ex. i have an append file that is created everytime I run a program but I need it to get deleted automatically because everytime I run the program it add the original number of files appended given the wrong result.)

thanks in advance!
# 2  
Old 02-19-2009
Quote:
Originally Posted by TDS
Is there a script that i could write to automatically delete a file everytime that it is created (ex. i have an append file that is created everytime I run a program but I need it to get deleted automatically because everytime I run the program it add the original number of files appended given the wrong result.)
Maybe you don't want to create that file Smilie
# 3  
Old 02-19-2009
but i don't know how not to create it because it is created automatically when i run my sas program through the append statement.
# 4  
Old 02-19-2009
You can do something like
Code:
rm file && run_application

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automatically correct a File Name

Hi All Need a help to understand how one can automatically correct a file name using a shell script even if it is in a completely different format... Ex : adv_OK_0215_mem_rules_firing.txt / advex_0215_OK_me_rule_fire.txt (or in any other format as above) to :... (13 Replies)
Discussion started by: chatwithsaurav
13 Replies

2. Shell Programming and Scripting

Opening a file in vi and automatically save and quit this file using shell script

Hi friends, In my shell script, I want to open a file using vi editor. After opening the file in vi, I want to save and quit this file automatically.... all through shell script. the code segment is: ------------------------------------------------------------ cd ~/netfpga/projects/scone/sw/... (2 Replies)
Discussion started by: sachinteotia
2 Replies

3. Linux

how to automatically create a file?

how can i automatically create a file on Linux? like a process that searches for the file and if the file does not exist, it automatically makes the file (3 Replies)
Discussion started by: roozis
3 Replies

4. UNIX for Dummies Questions & Answers

moving logs automatically but not removing

hello all, Need assistance on the subject line above. I have a logserver.log located at /usr/local/logserver. It's NSLOGDEPTH=100. I'm not sure if this is the reason but my log file retention is only up to 100 only.. sample logserver001.log logserver002.log ... ... logserver100.log ... (2 Replies)
Discussion started by: lhareigh890
2 Replies

5. Shell Programming and Scripting

Change file privileges automatically

Hi, Is it possible to write and run a shell script for specific directory( Apache/htdocs) that changes root privilege read/write to chmod 755 when a program uploads a file (word,PPT,XSL,..) to that directory Thanks, Mk (3 Replies)
Discussion started by: mkohan
3 Replies

6. Shell Programming and Scripting

Downloading a csv file automatically

I want to automatically download a CSV file daily which can be found here: London Stock Exchange - Search and the link is named "Click to download covered warrants (100Kb)" on the right hand side. What commands can I use to invoke clicking on this link and initiating the download? And also... (2 Replies)
Discussion started by: figaro
2 Replies

7. Shell Programming and Scripting

Extract lines from a file automatically. Please a Help

hello, hope you can help me: ive got a file called archivos The content or structure of this file is ./chu0/filechu ./chu1/filechu I extract each line from this file manually and redirect to a file, and it Works fine, so the command line is: awk ‘/chu0/ {print $0}' < archivos >... (8 Replies)
Discussion started by: alexcol
8 Replies

8. Shell Programming and Scripting

How to change automatically the file names

Hi all, I need to replace automatically all special characters of one filename with some corresponding characters For example > ö --> oe ä --> ae .... If the special character comes more than one time, then all the coccuerences have to be replaced. I would like to have a... (6 Replies)
Discussion started by: MAKY
6 Replies

9. Shell Programming and Scripting

Removing files automatically from a directory after 30 days.

Hello; I have a directory that is collecting log and act files. I need to write a script that will remove these files once they are 30 days old. I have read through a number of threads on this site that have given me a great deal of information. However I have what seems to be a unique... (7 Replies)
Discussion started by: justinb_155
7 Replies

10. Shell Programming and Scripting

Automatically Rename Last Generated File

I'm trying to rename the last generated file in a given directory using a makefile. If I type 'make build' the 'build' target produces a file (ie: text_001.txt). It automatically generates them sequentially, so I don't have control over the name. I can't say that it will always be text_001.txt.... (2 Replies)
Discussion started by: pieter023
2 Replies
Login or Register to Ask a Question