- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: if options in ksh
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
05-09-2006 09:55 PM
05-09-2006 09:55 PM
I have to check in a ksh script if a (users) directory ($HOME/v4_sap) exists.
In c-shell it's like:
'if ( -d $SAPDIR ) then'
What's in k-shell for $HOME/v4_sap?
Thanks in advance
Volkmar
Solved! Go to Solution.
- Tags:
- Test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 09:58 PM
05-09-2006 09:58 PM
SolutionCheck this out,
http://www.context-switch.com/reference/kshref/ch4.html
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 10:02 PM
05-09-2006 10:02 PM
Re: if options in ksh
if [ -d $HOME/v4_sap ]
then
......
fi
GOOD LUCK!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 10:06 PM
05-09-2006 10:06 PM
Re: if options in ksh
What about
SAPDIR=$HOME/v4_sap
if [ -d $SAPDIR ]
then
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 10:06 PM
05-09-2006 10:06 PM
Re: if options in ksh
something like below example.
if [ ! -d $SAPDIR ]
then
echo "Destination directory : $SAPDIR does not exist, unable to continue !" | tee -a $histlog
exit 1
fi
Best regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 10:06 PM
05-09-2006 10:06 PM
Re: if options in ksh
Thanks Arun and Warren!
Always searched the options in itrc, but found nothing.
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 10:07 PM
05-09-2006 10:07 PM
Re: if options in ksh
You are nearly there, just need square brackets.
if [ -d $HOME/v4_sap ]
then
echo "found"
else
echo "Not found"
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 10:09 PM
05-09-2006 10:09 PM
Re: if options in ksh
The same options only other brakets ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 10:44 PM
05-09-2006 10:44 PM
Re: if options in ksh
Thanks to all!