- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Env Params
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2002 03:47 AM
01-30-2002 03:47 AM
I don't want this duplicity (there's the length limit besides it's not nice...).
Any ideas how to solve this mess (on unix in general)?
Thanks,
Shachar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2002 04:03 AM
01-30-2002 04:03 AM
Re: Env Params
you can test if your env variable already contains the new value with a simple script like this:
ADDPATH=YES
for i in `echo $PATH | tr ':' ' '`
do
[ "$i" = "$NEWPATH" ] && ADDPATH=NO
done
[ "$ADDPATH" = "YES" ] && PATH=$PATH:$NEWPATH
Hope this helps
Ruediger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2002 04:19 AM
01-30-2002 04:19 AM
Re: Env Params
How about this:
if $a contains the directory you're interested in:
echo $path | tr ' ' '\012' | grep -q -x $a || set path = ( $path $a )
will only add $a if it's not already there.
Rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2002 12:19 AM
01-31-2002 12:19 AM
Re: Env Params
Robin,
Does this line will work in any shell (sh, sh, tcsh, ksh...), and will it work on sun?
Shachar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2002 01:00 AM