Concat required | Unix Linux Forums | Shell Programming and Scripting

  Unix/Linux Go Back    

Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Concat required

Shell Programming and Scripting

Closed Linux or Unix Question    
Thread Tools Search this Thread Display Modes
Old Unix and Linux 01-21-2013
coolboy98699 coolboy98699 is offline
Registered User
Join Date: Dec 2012
Last Activity: 24 April 2013, 6:55 PM EDT
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Concat required

Hi Folks
The below is code is giving me value 30.

cal | sed '/^$/d' | tail -1 | awk '{printf $NF-1}'

Actually the text is like below.

echo "you should reply on 30-Jan-2013 evening EST.

Here how should i con-cat above logic in that text?

Last edited by Scott; 01-21-2013 at 06:38 AM.. Reason: Code tags, please...
Sponsored Links
Old Unix and Linux 01-21-2013
elixir_sinari's Unix or Linux Image
elixir_sinari elixir_sinari is offline Forum Advisor  
Registered User
Join Date: Mar 2012
Last Activity: 9 October 2014, 4:50 PM EDT
Location: India
Posts: 1,412
Thanks: 101
Thanked 496 Times in 473 Posts
Quick and dirty:

echo "You should reply on $(date "+$(cal|awk 'NF{l=$NF}END{print l-1}')-%b-%Y") evening EST"

Last edited by elixir_sinari; 01-21-2013 at 06:45 AM..
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Concat kmsekhar Shell Programming and Scripting 4 07-25-2011 03:22 PM
Awk Concat posner Shell Programming and Scripting 3 07-28-2010 06:25 PM
Getting required fields from a test file in required fromat in unix rdhanek Shell Programming and Scripting 7 07-22-2009 12:35 PM
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 09:34 AM
Concat dhananjaysk Shell Programming and Scripting 1 03-20-2006 07:42 AM

All times are GMT -4. The time now is 08:34 AM.