Re: Variables in bash


Subject: Re: Variables in bash
From: James F. Zuelow Jr. (jamesz@ideafamilies.org)
Date: Mon Apr 01 2002 - 10:59:26 AKST


----- Original Message -----
From: "Mike Barsalou" <mbarsalou@aidea.org>
To: <aklug@aklug.org>
Sent: Monday, April 01, 2002 10:39 AM
Subject: Variables in bash

>
> How would I do:
>
> $dest = "/test/" ;
>
>
> in a bash shell?
>
> I want the variable $dest to have the value /test/. I have tried with
> quotes, without quotes, double quotes...I looked in the man page but
didn't
> find anything that would help me.
>
> I know it is something simple...but I don't use bash scripting
regularly
> enough.
>
> Mike

#!/bin/bash
DTE=`date +%y%m%d`
echo "The date in YYMMDD format is $DTE"
exit 0

you only use the $ to read the value, not assign the value.

Here's a handy link for you - might be overkill, but it makes an
excellent reference.

http://www.linuxdoc.org/LDP/abs/html/index.html

Cheers,

James



This archive was generated by hypermail 2a23 : Mon Apr 01 2002 - 10:59:57 AKST