By using shift, $1 becomes $2, $2 becomes $3, etc.. in the following line:
there is "$@" which stands for all parameters which originally would have been all parameters to the function, but because of the shift it has become parameters $2, $3, etc of the original parameters to the function.
Programmatically I do not really see what the purpose is in this case, since they could also have used:
But I would have to say the original is easier to read and understand, so that may be the reason..
The other thing - it prints to stderr - is logical since the usage is often printed when a user uses a wrong syntax.
Last edited by Scrutinizer; 05-04-2014 at 10:50 AM..
This User Gave Thanks to Scrutinizer For This Post:
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi, everyone.
I need to write a program to get io info based on libperfstat.
But the "write time" of a disk is just half of the value get from iostat.
I'm confused and can't explain. Help please.
How I calculate "write service time per sec":
In iostat:
write service... (0 Replies)
Hello All,
I'm trying to issue a conditional expression using "bc" on floating point numbers. I had this working on my linux box,
but as soon as I transferred the file over to an AIX Server, it would not work anymore...
This is the "WORKING" command on linux (below), which I can't seem to... (8 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
In all of my brief and superficial experience with Unix or Linux, the one curious and consistent thing has been that 'cd ./' (back up one directory level) has done absolutely nothing in any of them. Now I understand that, at least for bash, 'cd ./' appears to have been substituted by 'cd ..'
Am... (1 Reply)
Hi,
I need to find out the ASCII code for ALT-F1. The reason is that I'm using Expect to interact with an application and although I have the codes for keys such as 'Escape' (/033); F1 (\033\117\120) and ALT-F1 (\033\133\064\071\176) I have no idea where to find the code for Shift-F1.
The... (2 Replies)