Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

two 11.31 boxes, one unusual environment issue...

Regular Advisor

two 11.31 boxes, one unusual environment issue...

On one box, I can perfom the following:

unixID> cd /$EDI_TOP/$1
[/apps/finapps/custom/edi/1.0]-tphr12
unixID>


On the other, I can't:

unixID> cd /$EDI_TOP/$1
ksh: 1: parameter not set
[/tmp]-tphtr12
unixID>


Seems like one box ignores $1 (if it doesn't exist), while the other complains when isn't passed :(

any ideas?

thanks,
manny
4 REPLIES
Regular Advisor

Re: two 11.31 boxes, one unusual environment issue...

discovered the following:

set -u
you get the parm. not set


set +u
no issues :)

now just need to identify where this "set" is being set...

thanks

Honored Contributor Honored Contributor

Re: two 11.31 boxes, one unusual environment issue...

What you are telling did not make any sense. $1 is used for the first argument after the command itself. in a cd command, unless "cd" keyword is aliased to run a different script, $1 at the end of the directory you specify is not meaningful.

Please provide the output to command

alias

from both systems, separately, so that we can figure out if such an alias exists.
________________________________
UNIX because I majored in cryptology...
Acclaimed Contributor Acclaimed Contributor

Re: two 11.31 boxes, one unusual environment issue...

>set -u # you get the parm. not set
>now just need to identify where this "set" is being set.

Are you in a script or at the command prompt?
Typically you would rarely use $1 at the command prompt.

Look for "set -u" in .profile or in any .kshrc files. Or "-u" on your #! line at the top of your scripts.

Also look for "set nounset".
Highlighted
Honored Contributor Honored Contributor

Re: two 11.31 boxes, one unusual environment issue...

Hi,

you can issue a "set -o" at the command prompt on each server and compare the results. This will tell you what features are turned on/off on your (ksh) shell.

Regards,
Viktor
****
Unix operates with beer.