- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- build a string
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-13-2003 05:33 AM
06-13-2003 05:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:35 AM
06-13-2003 05:35 AM
Re: build a string
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:36 AM
06-13-2003 05:36 AM
Re: build a string
echo "ENDED: $(date +'%a %b %d')"
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:36 AM
06-13-2003 05:36 AM
Re: build a string
works too!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:36 AM
06-13-2003 05:36 AM
Re: build a string
Perhaps your question is badly worded, though: this is too easy. Here's another:
DATE="Sat Apr 12"
STATUS="ENDED:"
STRING="$STATUS $DATE"
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:37 AM
06-13-2003 05:37 AM
Re: build a string
not ENDED: Sat Apr 1 ( note position of numer one )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:37 AM
06-13-2003 05:37 AM
Re: build a string
I'm not so shure what you mean?
If you want to ptint this string it's like:
print "ENDED: Sat Apr 12"
If you want to take the date and format it
as you want you can use the "date" command
with parameter that spesify the format of
the output, check the man for the date
to see the parameters.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:40 AM
06-13-2003 05:40 AM
Re: build a string
try this:
DATE=$( date +"%a %b %e" )
STRING="ENDED: "$DATE
echo $STRING
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:40 AM
06-13-2003 05:40 AM
Re: build a string
That would be
echo "ENDED: $(date +'%a %b %e')"
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:42 AM
06-13-2003 05:42 AM
Re: build a string
try this one:
echo "ENDED: $(date '+%a %b %d')"
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:43 AM
06-13-2003 05:43 AM
Re: build a string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:49 AM
06-13-2003 05:49 AM
Re: build a string
quoting from "man date"
%e Day of the month as a two-character decimal number with
leading space fill [" 1"-"31" ]. For example, 12.
so %e should fulfill your requirements !
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:58 AM
06-13-2003 05:58 AM
Re: build a string
If you want to align a day value like one as ' 1' and not '1' use a formatted print, thusly:
# printf "ENDED: %s %s %2d\n" $(date +'%a') $(date +'%b') $(date +'%d')
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:59 AM
06-13-2003 05:59 AM
Re: build a string
echo ENDED: `./date -d 4/1/2003 +"%a %b %_d"`
See the archive at
http://hpux.cs.utah.edu/hppd/hpux/Gnu/sh_utils-2.0/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 06:00 AM
06-13-2003 06:00 AM
Re: build a string
Replace the %e for %d in my answer. This was taken from the date man pages.
%d Day of the month as a two-digit decimal number [01-31]. For
example, 12.
Regads,
Dario
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 06:03 AM
06-13-2003 06:03 AM
Re: build a string
Sorry Tom ..for only 3 pts ; your was first resolutive answer .