- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- What does a symbol ":" mean 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
Discussions
Discussions
Forums
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
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
тАО04-27-2009 12:35 PM
тАО04-27-2009 12:35 PM
I've found the following in some old ksh scripts :
1. :> $ERRORS
2. : ${name:="UNKNOWN"}
What does the string's first ":" mean?
I can't find it searching the Internet somehow.
Thanks,
Vita
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2009 02:01 PM
тАО04-27-2009 02:01 PM
SolutionIn other words, in your example 1.), the file named in the $ERRORS variable is going to be truncated to zero size (or created if it does not exist yet). This could be written without the ":", but apparently the script writer wanted to be explicit.
Your example 2.) sets the variable $name to value "UNKNOWN" if it is not previously set to some non-empty value. This requires the ":" in the beginning: otherwise the shell would attempt to run the command indicated by the $name variable (or if it was empty, it would try to run "UNKNOWN").
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2009 02:12 PM
тАО04-27-2009 02:12 PM
Re: What does a symbol ":" mean in ksh?
I guess it's a really rare usage of the command...
Vita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2009 06:57 PM
тАО04-27-2009 06:57 PM
Re: What does a symbol ":" mean in ksh?
if [ 0 -eq 0 ]; then
: do nothing # a comment won't work here
else
echo "this is false"
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2009 11:16 AM
тАО04-28-2009 11:16 AM
Re: What does a symbol ":" mean in ksh?
Thanks!