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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-24-2008
sbryant sbryant is offline
Registered User
 

Join Date: Jan 2008
Posts: 5
substr() thru awk Korn Shell Script

Hi qneill,

Thanks for your time to review my post.

I knew I am not clear myself because I am not a techie person.

This morning, I reviewed the Similar Thread section and found a solution to separate the file name fields using the awk command.
For example, a file named “XXXX.12345.YYYY” must be changed to “XXXX.12345”.
The echo result of the command line as echo “XXXX.12345.YYYY” | `awk –F. ‘{print $1}’` is “XXXX”. However, I need to use the same command line above for combining the first two fields of the file named “XXXX.12345” Is there a way to show the results of the first two fields of the file name?

Thanks,
sbryant
Reply With Quote