HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- About the script
Operating System - HP-UX
1828236
Members
2598
Online
109975
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
03-20-2003 07:29 PM
03-20-2003 07:29 PM
I am new comer to write a UNIX shell script, I have a simple question ,
I can run the command
# w -u
the result is normal, but why I can't set it as a variable in my script program :
# login = `w -u`
Password:
I can run the command
# w -u
the result is normal, but why I can't set it as a variable in my script program :
# login = `w -u`
Password:
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2003 07:34 PM
03-20-2003 07:34 PM
Solution
Hi,
First of all, you shouldn't use variable names such as "login", which in itself is a command. Next there is no space between the "=" sign. A more readable form would be:
logins=$(w -u)
Also, people may stop helping you if you continue to avoid assigning points. 0 from 100 posts is not good.
Cheers,
James.
First of all, you shouldn't use variable names such as "login", which in itself is a command. Next there is no space between the "=" sign. A more readable form would be:
logins=$(w -u)
Also, people may stop helping you if you continue to avoid assigning points. 0 from 100 posts is not good.
Cheers,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2003 07:35 PM
03-20-2003 07:35 PM
Re: About the script
login is command, that is why it is prompting for password.
say
juno=`w -u`
now echo $juno
say
juno=`w -u`
now echo $juno
There is no substitute to HARDWORK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2003 08:34 PM
03-20-2003 08:34 PM
Re: About the script
the syntax is like
variable = value
login is a command you can use it.
Just use any variable.
x=`w -u`
variable = value
login is a command you can use it.
Just use any variable.
x=`w -u`
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP