- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem with validation in a IF
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
06-07-2004 02:31 AM
06-07-2004 02:31 AM
i'm trying to validate a login in a IF statement but it's not working. What i'm doing is:
user_id=`whoami`
if [$user_id = "bsp" ]
elist=bsp@domain.com
fi
i've tried single quotes, double quotes and no quotes but it does not work.
I know that user_id=`whoami` works and that if i do elist=`whoami`@domain.com works also, the only thing i want to validate is if user_id = bsp
I know that it's probably a stupid syntax error that i'm doing but can't see what.
regards
PB
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 02:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 02:50 AM
06-07-2004 02:50 AM
Re: problem with validation in a IF
it didn't do anything.
I did:
if [ $user_id="bsp" ]
elist=bsp@domain.com
fi
regards
PB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 02:55 AM
06-07-2004 02:55 AM
Re: problem with validation in a IF
Maybe you have the wrong ` marks around your whoami command. Try the less confusing
user_id=$(whoami)
If not do this
user_id=$(whoami)
echo "user id is $userid"
if [ $user_id = "bsp" ]
then ### OOPS, you missed out this bit too
elist=bsp@domain
fi
echo "elist is $elist"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 03:23 AM
06-07-2004 03:23 AM
Re: problem with validation in a IF
Thanks