09-17-2011
Yes... I am on AIX.
Is this the issue because of any temporary files in the same directory created by Unix and those could not be located by find command?
Last edited by vk39221; 09-17-2011 at 01:01 AM..
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I want to find the exit status of the last executed command in C Shell.
Tried $? but getting the error Variable syntax...$? does not seem to work in C shell..
is there any other command in C shell to find the exit status of last command?
Thanks in advance,
raju (1 Reply)
Discussion started by: rajugp1
1 Replies
2. UNIX for Advanced & Expert Users
I am looking for all the header files (*.h).. which as per documentation of the UNIX system shouldbe there.
I am using
find / -name *.h -print
But it does't give anything.
My question is under what condition the "find" condition will fail to find the file?
What is the work around.
... (4 Replies)
Discussion started by: rraajjiibb
4 Replies
3. UNIX for Dummies Questions & Answers
I am executing a find command in my script i.e
find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \;
how do i check that this command is executed properly.. i would lke t trap the errror and display my error message
kinly help.. this is an urgent issue. (1 Reply)
Discussion started by: vijay.amirthraj
1 Replies
4. Shell Programming and Scripting
Hello gurus,
Tired of using $? to view the execution status of the previous command.
how can I get the status directly?
definitely this is not working,
if ]
then
fi (6 Replies)
Discussion started by: biglau
6 Replies
5. Programming
Hi All,
First of all thanks for reading this post.
In my application, I am trying to create a new message queue . I am attaching the code below.
mqd_t mqopen2(const char * pName,
unsigned long Flags,
long maxMsg,
long msgSz)
{... (15 Replies)
Discussion started by: parusasi
15 Replies
6. UNIX for Advanced & Expert Users
Hi,
Want to log the output of command & check the exit status to find whether it succeeded or failed.
> ls abc
ls: abc: No such file or directory
> echo $?
1
> ls abc 2>&1 | tee log
ls: abc: No such file or directory
> echo $?
0
Tee commands changes my exit status to be always... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies
7. UNIX for Dummies Questions & Answers
Hello All,
I am trying to capture the exit status of find command and want to delete the files only when it is successful. But it is always returning me as success even if the pattern of that file doesn't exist in the current directory. please help, checked manual page but couldn't able to figure... (6 Replies)
Discussion started by: Ariean
6 Replies
8. Shell Programming and Scripting
I have the following code in a script:
find . \( ! -name . -prune \) -name "cg*" -exec cp -p {} "${temp_dir}" \;
ret_stat=$?
I think the return status is only captured for the 'find' command and not for the 'cp' command. Is there a way to get the return status for the 'cp' command... (7 Replies)
Discussion started by: vskr72
7 Replies
9. UNIX for Dummies Questions & Answers
when I run the following command in AIX (bash),
find ./*
I get the following error.
find: bad status-- ./*
Thats becasuse, its an empty directory. The same works, when there the directory is not empty. Even though the find deesnt have to rerun any result.
My full find command would look... (4 Replies)
Discussion started by: deepakwins
4 Replies
10. UNIX for Beginners Questions & Answers
In a fastload teradata utility I am trying to delete the files which are older than 30days using the find and rm command as following.
find . -name 'xxx_*' -mtime +30 -exec rm -f {} \;
I expect it to delete all the files older than 30 days but sometimes it gives an error : find: bad status--... (3 Replies)
Discussion started by: stelkar
3 Replies
tmpnam(3S) tmpnam(3S)
NAME
tmpnam(), tempnam() - create a name for a temporary file
SYNOPSIS
DESCRIPTION
and generate file names that can safely be used for a temporary file.
Always generates a file name using the path-prefix defined as
in the header file. If s is NULL, leaves its result in an internal static area and returns a pointer to that area.
The next call to destroys the contents of the area. If s is not NULL, it is assumed to be the address of an array of
at least bytes, where is a constant defined in places its result in that array and returns s. For multi-thread
applications, if s is a NULL pointer, the operation is not performed and a NULL pointer is returned.
allows the user to control the choice of a directory.
The argument dir points to the name of the directory in which the file is to be created. If dir is NULL or points to
a string that is not an appropriate directory name, the path-prefix defined as in the header file is used. If that
directory is not accessible, is used as a last resort. This entire sequence can be up-staged by providing an envi-
ronment variable in the user's environment, whose value is the name of the desired temporary-file directory.
In order to request the default behavior for either or a NULL value must be passed in dir and pfx for or in s for If valid parameters are
not passed in, behavior is undefined.
Many applications are written such that temporary files have certain initial character sequences in their names. Use the pfx argument to
define a given prefix. The argument can be NULL or point to a string of up to five characters to be used as the first characters in the
temporary-file name.
uses (see malloc(3C)) to get space for the constructed file name, and returns a pointer to this area. Thus, any pointer value returned
from can serve as an argument to (see malloc(3C)). If cannot return the expected result for any reason; i.e., failed, or none of the above
mentioned attempts to find an appropriate directory was successful, a NULL pointer is returned.
Notes
and generate a different file name each time they are called, but start recycling previously used names if called more than times in a sin-
gle process.
Files created using these functions and either or (see fopen(3S) and creat(2)) are temporary only in the sense that they reside in a direc-
tory intended for temporary use, and their names are unique. It is the user's responsibility to use unlink(2) to remove the file when it
is no longer needed.
WARNINGS
Between the time a file name is created and the file is opened, it is possible for some other process to create a file with the same name.
This can never happen if that other process is using these functions or and the file names are chosen such that duplication by other means
is unlikely.
SEE ALSO
creat(2), unlink(2), malloc(3C), mktemp(3C), fopen(3S), tmpfile(3S), thread_safety(5).
STANDARDS CONFORMANCE
tmpnam(3S)