Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-16-2010, 03:48 PM   #1
LQ Newbie
Registered: Aug 2010
Posts: 1

Rep: Reputation: 0
Question on shell scripts

We have Redhat linux 5.5
I am writing a very simple bash shell script which consists of the following:
------------------------------------------ Shell script contents
DT_STAMP=`date +%Y%m%d%H%M`
echo $DT_STAMP
. ./
echo $LOG_FLD
echo "beforelog"
echo $LOG
echo "This is a test" > $LOG

------------------------------------------ contents
export RCD_FILE="file_name*.zip"
export LOG_FLD="/home/stage_location/"


When is executed, this is the output i get

As you can see the LOG variable is set to only DT_STAMP.log. the value of $LOG_FLD is missing

Can somebody please help me understand what is it that I may be missing?
Old 08-16-2010, 04:46 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Code: Shell script contents
DT_STAMP=`date +%Y%m%d%H%M`
echo $DT_STAMP
. ./
echo $LOG_FLD
LOG_FLD is not defined.

Last edited by bigrigdriver; 08-16-2010 at 04:48 PM.
Old 08-16-2010, 05:06 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
And how (from where) are you invoking
Old 08-16-2010, 05:25 PM   #4
Senior Member
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
That's a very wrong behavior. Can you directly echo "$LOG_FLD$DT_STAMP.log"?
echo "$LOG_FLD$DT_STAMP.log"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] A question about shell scripts. stf92 Programming 2 08-09-2010 09:01 PM
Question regarding start-up shell scripts pjdlmack Linux - Newbie 3 10-16-2009 12:23 AM
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 06:24 AM
shell scripts newbie_m Linux - Newbie 3 01-18-2005 08:12 PM
shell scripts... roofy Linux - Newbie 13 05-06-2003 06:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration