07-09-2006
$# != number
This is a simple code .
u pass the parameters at filename(refer command line arguments).
like
$> sh smaple.sh 1 2 3
here we passed three values.
$# represents the no.of parameters.
that means here $# contains a value that is #. ok.
In ur code it checks the no.of params r not equal to 1.
$* represents the values as a single string which r passed.
$@ represents the values as a single string which r enclosed in " "
aLL tHE bEST fREIND.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hallo
I want write a sh script but I have some troubles!
How can I write the Return value to a variable? I need an egrep command with the option -c, how many times it give the pattern. This return value shold be written in a variable.
Could you help me? (1 Reply)
Discussion started by: raphael.schwend
1 Replies
2. Shell Programming and Scripting
Could someone tell me that's the return value $? 15 mean? Where can i find out more?
Many thanks (3 Replies)
Discussion started by: gusla
3 Replies
3. Shell Programming and Scripting
I have 3 scripts
script A - wrapper script to disguise invoker true identity
script B - perform database operation and return a value (either W/H)
-> return value by echoing the result
script C - use script A to mask as the database owner then invoke script B to retrieve the value ... (1 Reply)
Discussion started by: mpang_
1 Replies
4. UNIX for Dummies Questions & Answers
How do I find out the return value of a shell script or program in Unix?
Is there a command to find that out?? (1 Reply)
Discussion started by: carl_vieyra
1 Replies
5. Programming
rm and cp return non zero values sometimes.
sprintf(tmp, "rm -rf %s/* 2>/dev/null\n", dest);
rc = system( tmp );
rc = 1 and errno =0
sprintf(tmp, "cp -r %s/* %s 2>/dev/null", source, dest);
rc = system( tmp );
rc = -1 and errno = 2.
The files exist and the paths are correct. I can... (7 Replies)
Discussion started by: latitude
7 Replies
6. UNIX for Dummies Questions & Answers
Hi,
What does the above command means?
this is used in the following function
function _set_return_code
{
return ${1-0}
} (3 Replies)
Discussion started by: neeto
3 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
8. Shell Programming and Scripting
I have write a shell function to get the maximum of a vector.
However, the returned value from the function is not always
the correct one.
Here is the script:
maxval()
{
local max j i size arrval
size=$1 ; shift
max=-999999999
i=0
while
do
arrval="$1"
if
then
... (5 Replies)
Discussion started by: fl0r10
5 Replies
9. Shell Programming and Scripting
ls xx > yy.log
echo $? can get the return value of "ls xx"
but if I use
ls xx |tee -a yy.log
I can't get the return value of "ls xx", and I get the return value of the whole cmd "ls xx |tee -a yy.log", it is always "0"
my question is how could I get the return value of "ls xx"... (1 Reply)
Discussion started by: yanglei_fage
1 Replies
10. Shell Programming and Scripting
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
LEARN ABOUT REDHAT
logredo
logredo(8) JFS utility - replay journal log logredo(8)
NAME
logredo - "replay" a JFS formatted device's journal log
SYNOPSIS
logredo device
DESCRIPTION
logredo applies all committed transactions recorded in the JFS journal log since the most recent synch point. Its goal is to put the JFS
file system in the state it would have been in if all transactions had been applied, in order, by the JFS file system itself.
device is the special file name corresponding to the actual device on which the journal log will be replayed (e.g. /dev/hdb1 ).
logredo must be run as root.
WARNING
logredo is called from within fsck.jfs, and is not recommended to be run as a stand-alone utility unless completely necessary, and only by
advanced users with a clear understanding of journaling in a file system.
BUGS
If you find a bug in JFS or logredo, please report it via the bug tracking system ("Report Bugs" section) of the JFS project web site:
http://oss.software.ibm.com/jfs
Please send as much pertinent information as possible, including any logredo error messages and the complete output of running fsck.jfs
with the -v option on the JFS device.
SEE ALSO
xchklog(8), xchkdmp(8), mkfs.jfs(8), fsck.jfs(8), logdump(8), xpeek(8)
AUTHORS
Barry Arndt (barndt@us.ibm.com)
William Braswell, Jr.
logredo is maintained by IBM.
See the JFS project web site for more details:
http://oss.software.ibm.com/jfs
October 10, 2001 logredo(8)