Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
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.
Sponsored Links
  #2 (permalink)  
Old 06-01-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,199
it would be nice to see a couple of lines from 'elig_jobs.txt' file......
  #3 (permalink)  
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.
  #4 (permalink)  
Old 06-01-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,199

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 09:45 AM..
  #5 (permalink)  
Old 06-01-2005
Registered User
 

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

Radhika.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0