![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
$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. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
it would be nice to see a couple of lines from 'elig_jobs.txt' file......
|
|
#3
|
|||
|
|||
|
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
|
||||
|
||||
|
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. |
|
#5
|
|||
|
|||
|
Thank You!!! so much. It works nicely.
Radhika. |
|||
| Google The UNIX and Linux Forums |