Creating a guessable tmp file in a public area like /tmp is a security risk.
It is safer to leave such a file, so the next time it is overwritten not created.
There a methods for a safer tmp file, see
Most safe is to avoid a tmp file. E.g. by using | and (sub shell).
Hi
im using the following to copy a file to a directory, the user being prompted to overwrite if the file already exists in that directory,
cp -i myfile /home/brief/bin2
but this reveals the path of the directory when being prompted to overwrite (below)
cp: overwrite... (2 Replies)
Dear All,
I have text file like this:
Header
Record 1
Record 2
.......
Record n
Tail
This line of code :
awk '{ if ( NR == 1 ) { head=substr($0,1,300);} else { last = substr($0,1,300);}END{printf "Header is : %-300s Trailer is : %-300s\n", head, last}' filename
converted Header... (11 Replies)
Hi guys,
I checked the knowledge base before posting this question.
is there any way by which you can ALWAYS ALLOW file overwrite in AWK?. i.e. an option similar to noclobber in Korn shell.
I don't to check for files existence and remove them. (1 Reply)
I'm debugging a ksh script written by someone else that does the following:
It runs a command and redirects stdout to a file called dberror that already exists using ">". This command fails with the following error:
The file access permissions do not allow the specified action. dberror:... (1 Reply)
my script is:
awk '...mycode...' file1.txt > file2.txt
and i want to overwrite file2.txt eachtime I run this script. but it says:File exists! :( I have tried
awk '...mycode...' file1.txt >| file2.txt but it again says:Missing name for redirect! :confused::confused:
what is this? (2 Replies)
How do you overwrite a directory with another directory? I know you can delete your directory then copy your directory over, but I would think there would be a way to do this in one step. (5 Replies)
Dear users,
I've been looking for a way to overwrite files only if both have the same size, how could I do this? any help is very appreciated.
Best regards,
Gery (5 Replies)
Hi Friends,
I have written a script to capture system performance every hour and redirected to output file. How to overwrite the file every next day?
Thanks
Suresh (4 Replies)
Discussion started by: suresh3566
4 Replies
LEARN ABOUT DEBIAN
ns_tmpnam
ns_tmp(3aolserver) AOLserver Built-In Commands ns_tmp(3aolserver)__________________________________________________________________________________________________________________________________________________NAME
ns_mktemp, ns_tmpnam - commands
SYNOPSIS
ns_mktemp template
ns_tmpnam
_________________________________________________________________DESCRIPTION
ns_mktemp returns a unique filename based on the template you specify. ns_tmpnam returns a filename that can safely be used for a tempo-
rary file.
The template for ns_mktemp should contain a string with six trailing Xs, which will be replaced with an alpha-numeric string of six charac-
ters chosen to make the filename unique. If template does not end with six trailing Xs the empty string will be returned.
ns_tmpnam calls the tmpnam() C library function, and the results will depend on your operating system. On Irix, for example, tmpnam()
always generate a file name using the path-prefix defined as P_tmpdir in the header file which is "/var/tmp/".
EXAMPLES
nscp> ns_tmpnam ;# On Linux
/tmp/filevuLwaE
nscp> ns_mktemp /tmp/foobar.XXXXXX
/tmp/foobar.p6SlaC
SEE ALSO nsd(1), mktemp(3), tmpnam(3)KEYWORDS AOLserver 4.0 ns_tmp(3aolserver)