specified path name is too long

 
Donald Thaler
Super Advisor

specified path name is too long

When trying to add $PATH=${PATH}:/lccc01/app/oracle/product/10.2.0/OPatch... i get the above error.

How do i go about shrinking the $PATH statement??
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: specified path name is too long

Shalom,

Shrinking the PATH. Hmmm

The fast was is to reset it and start over.

PATH=/usr/bin
export PATH

The geek way is to do this:

echo $PATH | awk -F: '{print $1 $2 ...$3}'

This can let you pick little pieces out of the path and again rebuild.

pathpart1=$(echo $PATH | awk -F: '{print $1}')

One variable at a time.

I'd just start over, the awk script is fun but I'm not ready to write it for you.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: specified path name is too long

The default PATH set by /etc/PATH is massively bloated...the majority of the paths are never used and certainly not needed. You start with /usr/bin and then add as convenient. Some of the paths don't even exist or point to unused software or applications. Even then, many applications only need one or two executables so putting an entire directory in the PATH is a waste. Instead, use alias to eliminate a long $PATH variable:

alias isql=lccc01/app/oracle/product/10.2.0/OPatch12/bin/isql


Bill Hassell, sysadmin