$HOME is not getting it's value.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting $HOME is not getting it's value.
# 1  
Old 06-01-2005
$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.
# 2  
Old 06-01-2005
it would be nice to see a couple of lines from 'elig_jobs.txt' file......
# 3  
Old 06-01-2005
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  
Old 06-01-2005
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  
Old 06-01-2005
Thank You!!! so much. It works nicely.

Radhika.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cp -p /home/* home/exp/*.date not working please help

:( ---------- Post updated at 01:51 AM ---------- Previous update was at 01:50 AM ---------- Not working ---------- Post updated at 02:04 AM ---------- Previous update was at 01:51 AM ---------- cp -p /home/* home/exp/*.`date` i am using this (4 Replies)
Discussion started by: rishiraaz
4 Replies

2. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

3. Programming

how to simulate "mkdir -p /home/blah1/blah2/blah3" in "c" where only /home exist

I'm trying to make use of mkdir(char *pathname, S_IRWXU) to create the directories. but it only creates one directory at a time. so I have to separate the tokens for "/home/blah1/blah2/blah3" as "home blah1 blah2 blah3" using delimiter "/", but it is again hectic to create such directory... (8 Replies)
Discussion started by: platinumedge
8 Replies

4. Linux

Need help w/home network

Hello world! I'm writing to you from Chile, Southamerica, and need a little help with my tiny home netwk. Hope you can give me a hand because this thing is breaking my balls. This is what i have: 1 windows box with XP pro (server) 1 linux box with DSL (box) 1 wrt54gl router with dd-wrt... (1 Reply)
Discussion started by: juanpedro
1 Replies

5. Solaris

solaris 10 /home

What gives? # chmod 777 home chmod: WARNING: can't change home # after I installed solaris 10, /home isnt writetable by anyone, when I try and change the perms as root, i get the above error. Anyone seen this before? (2 Replies)
Discussion started by: csaunders
2 Replies

6. Solaris

/etc/passwd $HOME

I would like to add a user with the following $HOME: /var/abc/AB!CD!DE/error yes - this directory actually exists on the system. I would like the user to log into the above directory. I have tried wrapping in single quotes (`) as well as using the escape (\) but I guess that I do not have... (9 Replies)
Discussion started by: andrewrgrayjr
9 Replies

7. Programming

HOME env

Do you know shell in Linux without HOME env. Best regards, Iliyan Varshilov (1 Reply)
Discussion started by: ilko_partizan
1 Replies

8. Solaris

/home Subdirectories

Hello: Could someone please explain to me how to create a subdirectory in the /home directory. I have tried creating a new user but the default path for a new user is /export/home. I am running Unix 5.8 on a Sun Blade 100. Thanks. (8 Replies)
Discussion started by: mawalton
8 Replies

9. UNIX for Dummies Questions & Answers

cd into home directory ~

I'm trying to cd into a home directory with cd ~username_here and I'm getting the following error: ~username_here: does not exist The directory exists and I can directly go to it via cd /export/home/username_here without any problems. Any suggestions? (4 Replies)
Discussion started by: here2learn
4 Replies

10. UNIX for Dummies Questions & Answers

Unix at home

Hi people its me again. Just reading some of the threads about people like myself newbies (god bless us). anyway the conundrum is. I only use unix at work and that has only been for the last 3 weeks. And i now find myself pondering wether or not to install in my machine at home. therein lies... (1 Reply)
Discussion started by: w33man
1 Replies
Login or Register to Ask a Question