0

This question already has an answer here:

I am facing following issue:

Input:

F=`date +%Y%m%d`

echo $F

Output:

F=20131231

But when trying this(File Name:A.sh):

C=`date`

G=`$C +%Y%m%d`

echo $C

echo $G

Output:

A.sh[6]: Tue:  not found

Tue Dec 31 06:14:12 EST 2013

I want to pass the date in a variable and then extract only date in a specific format.

merged by Michael Mrozek Jan 1 '14 at 9:03

This question was merged with Extract date from a variable in a different format because it is an exact duplicate of that question.

Browse other questions tagged or ask your own question.