- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- -e option not working 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-21-2007 10:12 PM
05-21-2007 10:12 PM
Version 11/16/88
i am trying a basic script
#!/usr/bin/ksh
set -x
filename="test.ksh"
echo "File name is " $filename
if [[ -e $filename ]]
then
echo "exists"
fi
but the script is giving an error
[tidrfx1g]nemana/ksh $ ./t1.ksh
+ filename=test.ksh
+ echo File name is test.ksh
File name is test.ksh
./t1.ksh[4]: syntax error at line 6 : `$filename' unexpected
i tried -f option.. it is working...
is this a problem with the version i have? Please help me..
Thanks in anticipation,
Satya Prasad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 10:15 PM
05-21-2007 10:15 PM
Re: -e option not working in ksh!!!!
Either your script isn't runing in the directory the file is supposed to be in or:
You may have a bug. There have been several patches to posix and korn shell over the years. I'd have them in anyway.
However, I favor the first paragraph of this post as the culprit.
ll > file.list
echo $filename >> file.list
right before the dash e statement and see if you are where you think you are.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 10:29 PM
05-21-2007 10:29 PM
Re: -e option not working in ksh!!!!
i doubt the first part....the version of the ksh which is the culprit as the same script with -e changed to -f worked.
i tried adding the lines to the script..
ll > file.list
echo $filename >> file.list
and observed the same result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 11:17 PM
05-21-2007 11:17 PM
Solutionit seems like -e doesn't exist as an option.
See:
http://www.context-switch.com/reference/kshref/ch4.html
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 11:20 PM
05-21-2007 11:20 PM
Re: -e option not working in ksh!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 11:36 PM
05-21-2007 11:36 PM
Re: -e option not working in ksh!!!!
You are correct.
In the following reference, i see the -e option.
http://www.cs.princeton.edu/~jlk/kornshell/doc/man93.html
But in the man page of year 88,
http://www.cs.princeton.edu/~jlk/kornshell/doc/man88.html
i dont,
which i guess is the current version i have on my system.
Thank you very much for the help...
Regards,
Satya Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 11:38 PM
05-21-2007 11:38 PM
Re: -e option not working in ksh!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 11:40 PM
05-21-2007 11:40 PM
Re: -e option not working in ksh!!!!
Since this is HP-UX why not use the POSIX shell --- the HP-UX standard shell in '/usr/bin/sh'?
This is wholly 'ksh' with full POSIX support.
Otherwise, you could use the Korn93 shell found in '/usr/dt/bin/dtksh'.
Substituting either interpreter ('/usr/bin/sh' or '/usr/dt/bin/dtksh' for '/usr/bin/ksh' will offer you a working script.
Regards!
...JRF...
- Tags:
- sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2007 04:04 PM
05-23-2007 04:04 PM