09-14-2012
$# return the number of argument.
This User Gave Thanks to delugeag For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am writing a shell script.
Now i need to read in a string and send it to an awk file to compare and search for compatible record.
I wrote it like tat:
read serial | awk -f generate.awk data.dat
p/s: the data file got 6 field.
According to an expert, we can write it like tat:
read... (1 Reply)
Discussion started by: AkumaTay
1 Replies
2. Shell Programming and Scripting
Dear All,
I have one script which accepts database name and user_id from the user, i have another script that will unload the data from all the tables based on the user_id accepted by the user. How can i pass the user_id from the 1st script to the other. My OS is sun solaris. Thanks in... (3 Replies)
Discussion started by: lloydnwo
3 Replies
3. Shell Programming and Scripting
Hi all,
I'm new to Shell scripting. In my shell script for Bourne shell, the script accepts a date parameter which is optional. If the value is supplied, the supplied value should be assigned to a variable. If not, the current date will be assigned to the variable. My script is like this.
#!... (9 Replies)
Discussion started by: sumesh.abraham
9 Replies
4. Shell Programming and Scripting
Hi All,
I have a question regarding running this script by passing an argument, for example ./ShellParse.sh sun, how do i do that? So i want when i pass argument sun, it shouild execute things inside the for loop. I want to support some other platforms too, so there are more for loops to... (3 Replies)
Discussion started by: asirohi
3 Replies
5. Shell Programming and Scripting
Dear All,
Plz, can someone clarify me regarding the below.
Actually I want to write the script that will get the some parameter like "yes" or "No" as we wish during execution without prompting for entering that word. Plz tell me...
Its Urgent..
Thanks & Regards
... (1 Reply)
Discussion started by: ks47
1 Replies
6. Shell Programming and Scripting
Hi Gurus,
I have written a script set_env.ksh to which I pass an argument and set the oracle login credentials based on the argument I pass.
The script has code as below.
ORACLE_SID=$1
DB_SCHEMA_LOGON=$DB_SCHEMA_USER/$DB_SCHEMA_PASSWORD@$ORACLE_SID; export DB_SCHEMA_LOGON;
echo... (3 Replies)
Discussion started by: Sabari Nath S
3 Replies
7. Shell Programming and Scripting
I have one working awk command line. Which taking data from the “J1202523.TXT” file and generating the “brazil.dat” file. PFB code.
awk '{ DUNS = substr($0,0,9);if ( substr($0,14,3) == "089" ) print DUNS }' J1202523.TXT > Brazil.dat
But now I want to pass two parameter as a command line argument... (4 Replies)
Discussion started by: humaemo
4 Replies
8. Shell Programming and Scripting
I have the awk script below and things go wrong when I do
awk -v dsrmx=25 -f ./checkSRDry.awk --usage
I basically want to override the usual --usage and --help that awk gives.
How do people usually handle this situation when you also want to supply your own usage and help
concerning the... (2 Replies)
Discussion started by: kristinu
2 Replies
9. Shell Programming and Scripting
Hi All,
I want to pass array of argument from Java to a shell script.I can use process builder api and its exec() method to call the script,but the question is how to receive the parameter in the script.
Thanks in advance
---------- Post updated at 10:00 PM ---------- Previous update was... (1 Reply)
Discussion started by: Abhijeet_Atti
1 Replies
10. Shell Programming and Scripting
Hi,
I am trying to pass a variable as an argument to another script. While substitution of variable, I am facing a problem.
varaiable "a" value should be -b "FPT MAIN".
When we pass "a" to another script, we are expecing it to get substitue as ./test.sh -b "FPT MAIN". But, it is getting... (9 Replies)
Discussion started by: Manasa Pradeep
9 Replies
LEARN ABOUT FREEBSD
elf_errmsg
ELF_ERRMSG(3) BSD Library Functions Manual ELF_ERRMSG(3)
NAME
elf_errmsg, elf_errno -- ELF library error message handling
LIBRARY
ELF Access Library (libelf, -lelf)
SYNOPSIS
#include <libelf.h>
int
elf_errno(void);
const char *
elf_errmsg(int error);
DESCRIPTION
When an error occurs during an ELF library API call, the library encodes the error using an error number and stores the error number inter-
nally for retrieval by the application at a later point of time. Error numbers may contain an OS supplied error code in addition to an ELF
API specific error code. An error number value of zero indicates no error.
Function elf_errno() is used to retrieve the last error recorded by the ELF library. Invoking this function has the side-effect of resetting
the ELF library's recorded error number to zero.
The function elf_errmsg() returns a null-terminated string with a human readable description of the error specified in argument error. A
zero value for argument error retrieves the most recent error encountered by the ELF library. An argument value of -1 behaves identically,
except that it guarantees a non-NULL return from elf_errmsg().
RETURN VALUES
Function elf_errno() returns a non-zero value encoding the last error encountered by the ELF library, or zero if no error was encountered.
Function elf_errmsg() returns a pointer to library local storage for non-zero values of argument error. With a zero argument, the function
will return a NULL pointer if no error had been encountered by the library, or will return a pointer to library local storage containing an
appropriate message otherwise.
EXAMPLES
Clearing the ELF library's recorded error number can be accomplished by invoking elf_errno() and discarding its return value.
/* clear error */
(void) elf_errno();
Retrieving a human-readable description of the current error number can be done with the following snippet:
int err;
const char *errmsg;
...
err = elf_errno();
if (err != 0)
errmsg = elf_errmsg(err);
SEE ALSO
elf(3), gelf(3)
BUGS
Function elf_errmsg() is not localized.
BSD
June 11, 2006 BSD