[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-newbie
Subject:    Re: trouble setting shell variable
From:       Jim Reimer - WA5RRH <wa5rrh () arrl ! net>
Date:       2002-05-26 16:44:34
[Download RAW message or body]

forgot about formatting....  that makes it a LOT easier.

thanks.

On Sunday 26 May 2002 10:58 am, Suriya Narayanan M S wrote:
> On Sunday 26 May 2002 7:37 pm, Jim Reimer - WA5RRH wrote:
>   > echo `date` | cut -b 25-28,12-13,15-16,18-19
>   >
>   > gives me what I want to use for the file name, but I
>   > can't figure out how to get it into a variable for use
>   > later in the script when I rename the file.  I've tried
>   >
>   > variablename=
>
> $ variablename=`echo \`date\` | cut -b 25-28,12-13,15-16,18-19`
> $ vim ${variablename}
>
> or
>
> $ variablename=`date | cut -b 25-28,12-13,15-16,18-19`
> $ vim ${variablename}
>
> To make life simple use the formatting available with date.
> eg.
> $ variablename=`date +%d-%b-%Y`
> $ echo ${variablename}
> 26-May-2002
>
> Hope that answers your question.
> Bye,
> Suriya Narayanan M S
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic