Computing.Net > Forums > Unix > Plugging Variables next to text

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Plugging Variables next to text

Reply to Message Icon

Name: werd
Date: August 25, 2008 at 09:26:29 Pacific
OS: UNIX
CPU/Ram: 1024
Product: star
Comment:

I am trying to set a variable by using these commands.

read date
date +%m%d%y

i can then use

$date

and get the correct output.

Now my question, is how can i get the out put of say

ACHARGE.%m%d%y

I know i can use the command

${date}acharge]

and get

%m%d%y-acharge

but no luck getting the format

acharge%m%d%y

Thank you for your time folks.



Sponsored Link
Ads by Google

Response Number 1
Name: wollie
Date: August 26, 2008 at 05:22:01 Pacific
Reply:

try this:

echo acharge-`date +%m%d%y`

cheers

Wollie


0

Response Number 2
Name: Jerry Lemieux
Date: August 28, 2008 at 16:53:35 Pacific
Reply:

It is as simple as date '+acharge-%m%d%y' which produces acharge-082808 as output. Forget that echo nonsense.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


BAT file - move command How to grep ??



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Plugging Variables next to text

PCL to Text www.computing.net/answers/unix/pcl-to-text/5896.html

Installing NT next to Linux and another NT www.computing.net/answers/unix/installing-nt-next-to-linux-and-another-nt/845.html

parsing a variable to a function www.computing.net/answers/unix/parsing-a-variable-to-a-function-/5613.html