- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- : comment?
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
тАО11-06-2001 10:15 PM
тАО11-06-2001 10:15 PM
# this is a comment
today I came across a script with
: this is a comment.
Is there any compelling reason, other than to flummox the reader, for one to use a colon instead of the good old hash?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2001 10:21 PM
тАО11-06-2001 10:21 PM
Re: : comment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2001 10:34 PM
тАО11-06-2001 10:34 PM
Re: : comment?
:this is a comment
sh: :this: not found.
:(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2001 10:35 PM
тАО11-06-2001 10:35 PM
Re: : comment?
if grep -qx $fs $EXCLUDE
then
: # To cater for ksh as ! command doesn't work
else
print - $block
fi
ksh wouldn't like the use of the : as it has special meaning.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2001 10:43 PM
тАО11-06-2001 10:43 PM
Re: : comment?
Try with a space after the ':'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2001 10:57 PM
тАО11-06-2001 10:57 PM
Re: : comment?
From animesh feedback it seems : does not act as a comment line signifier. It seems we have to live with the good old "#" only. Are you sure ":" is there to signify a comment line.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2001 11:28 PM
тАО11-06-2001 11:28 PM
Re: : comment?
$: this is a comment
$ It works now with space
:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2001 11:33 PM
тАО11-06-2001 11:33 PM
Re: : comment?
Cheers
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 12:09 AM
тАО11-07-2001 12:09 AM
Re: : comment?
OLD IS GOLD. better stick to that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 12:15 AM
тАО11-07-2001 12:15 AM
SolutionThe : or null command, is commonly used in if-else-fi blocks, where you cannot get away with executing nothing, e.g.
=====================================
#!/bin/ksh
if [ -f /etc/passwd ] ; then
#
else
echo passwd file missing
fi
=====================================
will fail - you need to put a : in place of the # for this to work. You could negate the if statement, but you may want to modify the script at a later stage with the existing if syntax.
Rgds, Robin.