The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-05-2008
jerrynimrod jerrynimrod is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 4
String manipulation

Hi,

i am just gettin exposed to UNIX.
Could anyone of u help me out with dis problem..?
i have a variable 'act' which has the value as follows,

echo $act gives -0- -0- -----0---- 2008-06-04 -0- -0-
echo "$act" | awk '{print ($act)}'
gives,
-0-
-0-
-----0----
2008-06-04
-0-
-0-

I want only the value 2008-06-04 to be placed in a new variable, say data
ie data=2008-06-04

Pls help me out,
Thanks,
Jerry