- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- C-Shell dynamic DISPLAY variable setting problem.
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
12-07-2004 04:01 AM
12-07-2004 04:01 AM
Is there any way to dynamically set the IP address in DISPLAY variable in users login C-shell file .cshrc. This will help me to use my X client from any workstation.
Thanks,
Gula
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:04 AM
12-07-2004 04:04 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:08 AM
12-07-2004 04:08 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
{belfast- peel20} 23>>setenv DISPLAY=`getip "$(who -um|awk '{print NF}'")`:0.0
setenv: Too few arguments.
{belfast- peel20} 24>>
Gulam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:12 AM
12-07-2004 04:12 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
Syntax errors in earlier post. This should work.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:14 AM
12-07-2004 04:14 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:14 AM
12-07-2004 04:14 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
{belfast- peel20} 35>>setenv DISPLAY="`getip "$(who -um|awk '{print NF}')"`:0.0"
Variable syntax.
Gulam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:29 AM
12-07-2004 04:29 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
Now, as Clay said, if you already come with a XDMCP connection you may already have a :0.0 part. So you will have this : IP:0.0:0.0...
Solution may be something like that :
setenv DISPLAY "$(who -um|awk '{print $NF}'|cut -d : -f1)"
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:33 AM
12-07-2004 04:33 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
{belfast- peel20} 17>>setenv DISPLAY "$(who -um|awk '{print $NF}'|cut -d : -f1)"
Variable syntax.
Thanks,
Gulam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:41 AM
12-07-2004 04:41 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
# setenv DISPLAY "$(who -um|awk '{print $NF}'|cut -d : -f1)"
Variable syntax.
# setenv DISPLAY `who -um|awk '{print $NF}'|cut -d : -f1`
Second syntax works fine.
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:46 AM
12-07-2004 04:46 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
Thnaks for your help.
Gulam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 04:59 AM
12-07-2004 04:59 AM
SolutionPS. C shell should be avoided like the plague.
set XX=`who -um | awk '{ split($NF,x,":"); print x[1] }'`
setenv DISPLAY `getip ${XX}`:0.0
unset XX
The intermediate variable XX simplifies the task and is undefined afterwards. This also takes care of the case where who -um return "hostname:0.0" or "hostname" or "10.1.2.3" or "10.1.2.3:0.0". If I got all the single quotes and backticks correct that should do you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 05:06 AM
12-07-2004 05:06 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
Thanks all for your quick responses.
Regards,
Gulam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 05:09 AM
12-07-2004 05:09 AM
Re: C-Shell dynamic DISPLAY variable setting problem.
Try
setenv DISPLAY `who am i -R |awk '{print $6}'|tr -d "()"`:0.0
There is a space after setenv and after DISPLAY.
Hope this helps.
Regds