Solved

Unix ksh sed: cut string in two variables

Posted on 2011-03-23
2
1,868 Views
Last Modified: 2012-05-11
How do I create a seperate Date and Time variable from this string...
DateTime=2011-03-21T12:11:00

So that it becomes...
Date=2011-03-21
Time=12:11:00


Thank you for your much appreciated help.
0
Comment
Question by:Watnog
2 Comments
 
LVL 14

Accepted Solution

by:
sjm_ee earned 500 total points
ID: 35196880
In ksh:

# echo $Date
2011-03-21T12:11:00
# echo $DateTime | IFS="T" read Date Time
# echo $Date
2011-03-21
# echo $Time
12:11:00


0
 

Author Closing Comment

by:Watnog
ID: 35196909
Very nice. Thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now