Unix Shell - korn question

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > March 2005 > korn question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author korn question
Michael A

2005-03-05, 5:57 pm

Hi,

what's the difference between set - 1 2 3 and set -- 1 2 3
I can't find any refs under man ksh .

the result seems to be the same $1 $2 $3 are set to 1 2 3

thanks
Michael

Janis Papanagnou

2005-03-05, 8:47 pm

Michael A wrote:
> Hi,
>
> what's the difference between set - 1 2 3 and set -- 1 2 3
> I can't find any refs under man ksh .
>
> the result seems to be the same $1 $2 $3 are set to 1 2 3
>
> thanks
> Michael
>


Quoting set --man

"If no args are specified, not even the end of options argument --, the
positional parameters are unchanged. Otherwise, unless the -A options has
been specified, the positional parameters are replaced by the list of args. A
first arg of -- is ignored when setting positional parameters.

For backward compatibility, a set command without any options specified whose
first arg is - will turn off the -v and -x options. If any additional args
are specified, they will replace the positional parameters."


Janis
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com