Perl has a module used for this purpose File::Find which should be more efficient than shelling out to the find command. It is also easy enough to code if you don't need to search sub directories
Guys,
I have a script that should change one of the configuration Parameter in a http accelerator, this config change which will halt http traffic into device. So I have designed a script which should do these changes. But after executing this script, found that one of the input variable is not... (8 Replies)
Hi All,
i have two machines like x and y . my requirement is i should connect to machine Y from x through ssh connection . and do some operation such as copy and move and delete files in Y machine .
i tried with this code but it is doing in machine x only . and i need to exit from Y when... (1 Reply)
Hello experts
I want to execute a awk command, which reads from txt files and sums the numbers from the first column for those listed only inside a <init> block -- The awk command is like
awk '/<\/?init>/{x = !x}x{a++}x && a > 2{sum+=$1}END{printf"%E" "\n", sum}
So, I want to execute... (2 Replies)
Hello All
I am facing an issue
The unix script is running fine in unix environment which uses ssh connection but when I try to run the same in informatica environment (same server where I was running the unix script manually successfully) its showing the below error
command-line line 0:... (11 Replies)
Hi,
I have situation where i need to automate transferring 10000+ files using sftp.
while read line
do
if ; then
echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt
fi
done< files.txt
sftp -b sftpCommand.txt stu@192.168.2.1
The above... (1 Reply)
I'm trying to learn how to use cron for repetative tasks. I have an external disk that needs to be unmounted and remounted every hour due to some problems that a backup utility (specifically, TimeMachine) is having repeatedly accessing the device. I've created a shell script that will find the... (3 Replies)
i have perl script that used to be working great , once i edit it in windows
and convert it to UTF-8 and then via FTP return it .
also did:
chmod +x foo.pl
and then when i try to run it :
./foo.pl
im getting this error:
./foo.pl: Exec format error. Wrong Architecture.... (4 Replies)
Hi,
I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to exit from CLI object (not from shell script) in my shell script.
My intension is to execute... (4 Replies)
Hi Gurus,
The following script fails with the error 'command not found' while trying to execute. As the error indicates, the script fails at ROW#30 where the EOF is defined for SQL statement.
It appears that the script is trying execute the lines in the SQL output written to ta spool file.... (7 Replies)
Discussion started by: svajhala
7 Replies
LEARN ABOUT OPENSOLARIS
fdopendir
opendir(3C) Standard C Library Functions opendir(3C)NAME
opendir, fdopendir - open directory
SYNOPSIS
#include <sys/types.h>
#include <dirent.h>
DIR *opendir(const char *dirname);
DIR *fdopendir(int fildes);
DESCRIPTION
The opendir() function opens a directory stream corresponding to the directory named by the dirname argument.
The fdopendir() function opens a directory stream for the directory file descriptor fildes. The directory file descriptor should not be
used or closed following a successful function call, as this might cause undefined results from future operations on the directory stream
obtained from the call. Use closedir(3C) to close a directory stream.
The directory stream is positioned at the first entry. If the type DIR is implemented using a file descriptor, applications will only be
able to open up to a total of {OPEN_MAX} files and directories. A successful call to any of the exec functions will close any directory
streams that are open in the calling process. See exec(2).
RETURN VALUES
Upon successful completion, opendir() and fdopendir() return a pointer to an object of type DIR. Otherwise, a null pointer is returned and
errno is set to indicate the error.
ERRORS
The opendir() function will fail if:
EACCES Search permission is denied for the component of the path prefix of dirname or read permission is denied for dirname.
ELOOP Too many symbolic links were encountered in resolving path.
ENAMETOOLONG The length of the dirname argument exceeds {PATH_MAX}, or a path name component is longer than {NAME_MAX} while
{_POSIX_NO_TRUNC} is in effect.
ENOENT A component of dirname does not name an existing directory or dirname is an empty string.
ENOTDIR A component of dirname is not a directory.
The fdopendir() function will fail if:
ENOTDIR The file descriptor fildes does not reference a directory.
The opendir() function may fail if:
EMFILE There are {OPEN_MAX} file descriptors currently open in the calling process.
ENAMETOOLONG Pathname resolution of a symbolic link produced an intermediate result whose length exceeds PATH_MAX.
ENFILE Too many files are currently open on the system.
USAGE
The opendir() and fdopendir() functions should be used in conjunction with readdir(3C), closedir(3C) and rewinddir(3C) to examine the con-
tents of the directory (see the EXAMPLES section in readdir(3C)). This method is recommended for portability.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |opendir() is Standard; |
| |fdopendir() is Evolving |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO lstat(2), symlink(2), closedir(3C), readdir(3C), rewinddir(3C), scandir(3C), attributes(5)SunOS 5.11 26 Jun 2007 opendir(3C)