On my system I created a symbolic link called temp1 pointing to /etc/passwd and then I used touch to create a file called temp1 to see what would happen. But when I tried to create the file with touch, most likely because the symbolic link called temp 1 was already there.
It's safe enough to touch /etc/passwd, but imagine what would happen if you'd overwrote it instead.
Using that predictable a name for your temp files has another problem though: What if you want to run two instances of your script at once? I usually do something like
so each process has a different tempfile. That's only a half step away from using mktemp...
Hi
I believe there is a method to remove all temporary files when a KSH script terminates (either expectedly or unexpectedly).
I think is some sort of subroutine you can create that runs when the script exits. Can anyone help me with this please?
Many thanks
Helen :confused: (2 Replies)
Hi all, new to the threads as well as Unix/Linux. I need to create a script that will delete any temporary files as well as check the files on the system for errors or corruption. This is what I have so far and I'm sure that I'm missing things or have the wrong commands. I'm not sure where to go... (3 Replies)
Hi everyone,
Looking for a suggestion to improve the below script in which I´ve been working.
The thing is I have 3 separated AWK scripts that I need to apply over the inputfile, and for scripts (2) and (3) I have to use a "temp" file as their inputfile (inputfile_temp and inputfile_temp1... (2 Replies)
Hello Friends
I am currently facing high CPU usage problem which is making my site extremely slow.
Currently I am using a 8GB RAM with 8 cores but, the creation of temporary files is eating away a lot of the CPU resource making the site very slow.
The normal CPU load average remains below 2-3... (5 Replies)
Hi there,
As a regular unix user I am forever programming on the command line or writing scripts so that I first write a load of data to a file to read from. In the end I am always left with a bundle of .txt, .tmp which is what I usually call them. As a basic programmmer I was wondering is... (6 Replies)
HI,
I am from testing background. I have a scenario of a file generation, through cronjob, on a defined path.
After I fill the data as 100 % utilized, my application is generating an empty file on the defined path.
# df -kh
Filesystem Size Used Avail Use% Mounted on... (3 Replies)
I'm looking for help with finding where plugin data and other page resources are stored on the hard disk in safari 6.0. With the new update, the activity window has been merged into the develop menu under "show page resources" and one cannot access them directly.
I tried running opensnoop to see... (3 Replies)
Hi,
I've a script which creates a temp flat file for storing all business dates received on a single day from diff control files sent by source system on that day.
e.g on 12th april I receive txns for business day 8,9,10,11 april.
I capture this business day and append to a flat file from... (1 Reply)
Heyas
As some applications (sed,grep,vi, etc) create some tempfiles, i'd changed a script to this: (sadly i cant find the original post (code) anymore (which just removed 2 'diffrent kinds'), just similar ones - forgot that as i was new to all this)
:) ~ $ cat $(which rmtf)
#!/bin/sh
#... (1 Reply)
Hi All,
I am having a situation now to delete a huge number of temp files created during run times approx. 16700+ files. We have never imagined that we will get this this much big list of files during run time. It worked fine for lesser no of files in the list. But when list is huge we are... (7 Replies)
Discussion started by: mad man
7 Replies
LEARN ABOUT FREEBSD
gzexe
GZEXE(1) BSD General Commands Manual GZEXE(1)NAME
gzexe -- create auto-decompressing executables
SYNOPSIS
gzexe [-d] file ...
DESCRIPTION
The gzexe utility uses gzip(1) to compress executables, producing executables that decompress on-the-fly when executed. This saves disk
space, at the cost of slower execution times. The original executables are saved by copying each of them to a file with the same name with a
'~' suffix appended. After verifying that the compressed executables work as expected, the backup files can be removed.
The options are as follows:
-d Decompress executables previously compressed by gzexe.
The gzexe program refuses to compress non-regular or non-executable files, files with a setuid or setgid bit set, files that are already com-
pressed using gzexe or programs it needs to perform on-the-fly decompression: sh(1), mktemp(1), rm(1), echo(1), tail(1), gzip(1), and
chmod(1).
SEE ALSO gzip(1)CAVEATS
The gzexe utility replaces files by overwriting them with the generated compressed executable. To be able to do this, it is required that
the original files are writable.
BSD January 26, 2007 BSD