1

I have 4 names (AA,BB,CC,DD) in a config file. This has been used in a script.

I am trying to get the output to be saved as

Source_Server_Path="/dev/FtpData_Files/START_STOP_"$1"_"$Current_Date"" 

where $1 will be any one in the names.

$Current_Date has to be in the format 05Jun2013.

2 Answers 2

4
$ foo="/bar/quux/$(date +%d%b%Y)" $ echo "${foo}" /bar/quux/07Jun2013 

See also man date.

Sign up to request clarification or add additional context in comments.

Comments

2

Sample script/method ... Try if it helps

config.txt

AA,BB,CC,DD 

Script.sh

file=$1 config=`cat $file | awk -F "," '{print $1}'` #It will take AA .. whatever parameter you pass Current_Date=`date +%d%b%Y` echo START_STOP_"$config"_"$Current_Date" 

How to run

 sh script.sh config.txt 

Output

START_STOP_AA_07Jun2013 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.