08-13-2002
We can have one possible solution. Create a structure whose member variables would be a character array and a File pointer/Descriptor. Whenever a file is opened successfully , copy the file name into the character array member variable of the structure.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i'd like to have an alias (or something similar) where i can type a command like "archive" and a filename and have it tar and gzip the file, so...
$ archive filename
results in filename.tar.gz...do i have to write a script to do this? (4 Replies)
Discussion started by: bcamp1973
4 Replies
2. Solaris
Hi all,
What do you mean when you say
if
then
<some instructions>
fi
I know that it first checks if the <filename> is a ordinary file and if it exists and if so then goes ahead with the loop..
However what is the need to check if its a file or not...(unless there is a block device... (3 Replies)
Discussion started by: wrapster
3 Replies
3. Shell Programming and Scripting
Anyone who can assist :
I am trying to pass the group vairiable to a filename:
rpt_tsavegrp=/export/legato/scripts/$group_savegrp_rpt.$dat
It will not pass to variable.
Anyone have any ideas what I am doing wrong here.
Thanks
# This script sends email that save group completed.... (3 Replies)
Discussion started by: gzs553
3 Replies
4. Shell Programming and Scripting
I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies
5. Shell Programming and Scripting
i have several thousand files and in subdirs that are named
file.46634.txt
budget.75346.pdf
etc
i want to remove the number but retain the extension.
it is always a 5 digit.
thanks. (6 Replies)
Discussion started by: jason7
6 Replies
6. Shell Programming and Scripting
Hi all,
I have a list of xml file. I need to split the files to a different files when see the <ko> tag.
The list of filename are
B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml
B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml
B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml
... (3 Replies)
Discussion started by: natalie23
3 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
I was wondering why tail -n 2 filename produce an error when I manage to do similar command on head -n 2 filename
SunOS{type8code0}: tail -n 2 filename
usage: tail ]
tail ] (2 Replies)
Discussion started by: type8code0
2 Replies
8. Shell Programming and Scripting
Hi, Gurus,
I feel sorry to ask this easy question, but to be honest, I really don't know.
I have a question about execute shell script.
I have script named as filename.sh with -rwxr-xr-x permission.
when I execute it with
. filename.sh
It works properly.
when I exec it with
sh... (7 Replies)
Discussion started by: ken002
7 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
Thanks in Advance
I am working on a shell script. I need some assistance.
My Requirement:
1) There are some set of files in a directory like given below
OTP_UFSC_20120530000000_acc.csv
OTP_UFSC_20120530000000_faf.csv
OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies
10. Programming
Hi All,
Thanks in Advance
I am working on a shell script. I need some assistance.
My code:
if
then
set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\
"pam_account";
for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Discussion started by: aealexanderraj
0 Replies
LEARN ABOUT FREEBSD
elf_getarsym
ELF_GETARSYM(3) BSD Library Functions Manual ELF_GETARSYM(3)
NAME
elf_getarsym -- retrieve the symbol table of an archive
LIBRARY
ELF Access Library (libelf, -lelf)
SYNOPSIS
#include <libelf.h>
Elf_Arsym *
elf_getarsym(Elf *elf, size_t *ptr);
DESCRIPTION
The function elf_getarsym() retrieves the symbol table for an ar(1) archive, if one is available.
Argument elf should be a descriptor for an ar(1) archive opened using elf_begin() or elf_memory().
If the archive elf contains a symbol table with n entries, this function returns a pointer to an array of n+1 Elf_Arsym structures. An
Elf_Arsym structure has the following elements:
char * as_name
This structure member is a pointer to a null-terminated symbol name.
off_t as_off
This structure member contains the byte offset from the beginning of the archive to the header for the archive member. This value is
suitable for use with elf_rand(3).
unsigned long as_hash
This structure member contains a portable hash value for the symbol name, as computed by elf_hash(3).
The last entry of the returned array will have a NULL value for member as_name, a zero value for member as_off and an illegal value of ~0UL
for as_hash.
If argument ptr is non-null, the elf_getarsym() function will store the number of table entries returned (including the sentinel entry at the
end) into the location it points to.
RETURN VALUES
Function elf_getarsym() returns a pointer to an array of Elf_Arsym structures if successful, or a NULL pointer if an error was encountered.
If argument ptr is non-null and there was no error, the library will store the number of archive symbol entries returned into the location it
points to. If argument ptr is non-null and an error was encountered, the library will set the location pointed to by it to zero.
ERRORS
Function elf_getarsym() may fail with the following errors:
[ELF_E_ARGUMENT] Argument elf was NULL.
[ELF_E_ARGUMENT] Argument elf was not a descriptor for an ar(1) archive.
SEE ALSO
elf(3), elf_begin(3), elf_getarhdr(3), elf_hash(3), elf_memory(3), elf_next(3), elf_rand(3)
BSD
August 15, 2006 BSD