- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to set environment available in script!
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
09-24-2003 06:08 PM
09-24-2003 06:08 PM
how to set environment available in script!
i set the PATH environment available in my script
the following:
PATH=/usr/sbin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettla
dm/bin:/opt/graphics/common/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/upgrade/b
in:/opt/langtools/bin:/opt/perf/bin:/opt/imake/bin:/opt/hpxt/enware/bin:/opt/hpn
p//bin:/opt/hparray/bin:/sbin:/home/root
one line can't hold all the items
when i execute my script(shellx.txt)# ./shellx.txt
the following error message is produced:
./shellx.txt[3]: dm/bin:/opt/graphics/common/bin:/usr/bin/X11:/usr/contrib/bin/X
11:/opt/upgrade/b: not found.
./shellx.txt[4]: in:/opt/langtools/bin:/opt/perf/bin:/opt/imake/bin:/opt/hpxt/en
ware/bin:/opt/hpn: not found.
./shellx.txt[5]: p//bin:/opt/hparray/bin:/sbin:/home/root: not found.
how can set the available correctly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2003 06:39 PM
09-24-2003 06:39 PM
Re: how to set environment available in script!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2003 06:46 PM
09-24-2003 06:46 PM
Re: how to set environment available in script!
#!/bin/sh
#Env Setting---------
# source the following file to export
# all required env variables, such
# as PATH, ORACLE_SID, ORACLE_HOME...
. /home/oracle/.scriptenv
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2003 07:25 PM
09-24-2003 07:25 PM
Re: how to set environment available in script!
When editing your script with "vi", in command mode use ":set list" to view where are the new-lines ( will be "marked" with a dollar symbol ).
As mentioned, looks like you have undesirable new lines in your PATH line.
Kind regards,
Zigor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2003 07:42 PM
09-24-2003 07:42 PM
Re: how to set environment available in script!
as Mark said, your problem is probably that you did a copy-paste from another source and included erronous newlines in your script.
However, if you still want to add pathes to an existing PATH variable, all you have to do is:
PATH=$PATH;[your new pathes]
Cheers,
FiX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2003 08:17 PM
09-24-2003 08:17 PM
Re: how to set environment available in script!
You can use:
export PATH=$PATH:/dir1:/dir2:/dir3
export PATH=$PATH:/dir4:/dir4:/dir6
...
to assign more path!
As I know, the maximum length for POSIX shell variable is 128 characters (maybe), so the strings above 128 will be truncated!
-ux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2003 11:29 PM
09-24-2003 11:29 PM
Re: how to set environment available in script!
1. PATH=/usr/sbin:... till /usr/contrib/bin
in the nest line
2. PATH=$PATH:/opt/nettladm and so on..
This will solve your problem.