The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
HOME env ilko_partizan High Level Programming 1 02-27-2008 01:23 PM
HOME env ilko_partizan Shell Programming and Scripting 1 02-27-2008 04:15 AM
what does it mean . $HOME/920.env vishalpatel03 Shell Programming and Scripting 2 01-09-2008 10:41 AM
how to set $HOME? sachin.gangadha UNIX for Dummies Questions & Answers 2 12-13-2007 12:10 PM
Configuration for a home LAN cbkihong IP Networking 1 11-03-2002 03:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-01-2005
Registered User
 

Join Date: Apr 2005
Posts: 51
$HOME is not getting it's value.

#!/bin/ksh
while read line < elig_jobs.txt
do
#Gets the field from the elig_jobs.txt file that has the input location path.
INPUTD=`echo "$line" | cut -c240-289` (ex: $HOME/2005)

echo inputdirectory: $INPUTD (this prints $HOME/2005)

I want it to print /data/user/2005 rather than $HOME/2005/ Could some body please see what's the problem here. I even tried with double quotes:
echo inputdirectory: "$INPUTD" it still prints $HOME/2005


ThankYou,
Radhika.
Reply With Quote
Forum Sponsor
  #2  
Old 06-01-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
it would be nice to see a couple of lines from 'elig_jobs.txt' file......
Reply With Quote
  #3  
Old 06-01-2005
Registered User
 

Join Date: Apr 2005
Posts: 51
elig_jobs.txt file is a file with some data about a .dat file-

Row 1-------------------------
Eligibility 1 120050320050516122117xxx121_xxxxx_tgt_bn*.dat
gsk_target_bonus.txt $HOME/2005/ \\serverxxxx\ssd_sim\Data

Row 2-------------------------
Eligibility 2 220050320050516122117xxx121_xxxxx_sta*.dat
gsk_rep_status.txt $HOME/2005/ \\serverxxxx\ssd_sim\Data


For your testing purposes I think it would be simple to consider a simple text file with
$HOME/2005 as data in one row.
And use
INPUTD=`echo "$line" | cut -c1-10` (ex: $HOME/2005) to clip the path from the file.
Reply With Quote
  #4  
Old 06-01-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
Code:
#!/bin/ksh

while read line
do
   INPUTD=`eval echo "$line" | cut -d ' ' -f5`

   echo inputdirectory: $INPUTD
done < elig_jobs.txt

Last edited by vgersh99; 06-01-2005 at 05:45 AM.
Reply With Quote
  #5  
Old 06-01-2005
Registered User
 

Join Date: Apr 2005
Posts: 51
Thank You!!! so much. It works nicely.

Radhika.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0