Need help with a script in Korn

Cybermastif

Senior member
May 18, 2001
257
0
0
Ok ladies and gents I need a bit of help on this script I have written in a Korn shell.

The problem I am having is that I am trying to get the user to type in a backup name that has to be added to our ongoing list, the only problem is that for some reason the script is not waiting for the user to enter anything. This same issue is happening when the user attempts to enter the name of the backup that needs to be removed from the script.

I don't get why this is happening, esp since I have no problem on a different script that the user enters the date that is going to grepped for...

I am writing this on a solaris 2.5 system, and I am not sure exactly which version of Korn it is.

Any help on this is appreciated....

Cybermastif
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
maybe you can post the script or the snippet of the script?
as well as how you run it?
i know i had some problems back then (with bourne sh) depending on how i run it on command line .... maybe it's that?

but the again, code or partial code will be helpful (although i'm not sure my crappy ksh knowledge will help much)

-1055-
 

Cybermastif

Senior member
May 18, 2001
257
0
0
ok here is where the issue is:

echo "Please use the same form as this example: xxxxxx xxxxx_xxx xxxx_xxxx"
echo
echo "Enter the archive you wish to remove from the current archive list: \c"
read 2b_removed_archive_name in
echo $2b_removed_archive_name >> temp_archive_name
comm -23 Current_archives temp_archive_name >temp_carchives
rm -f Current_archives
mv temp_carchives Current_archives


as far as how I am running it, simply using the command prompt with ./

I have permissions currently set to 777.

tia!

Cybermastif
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
echo "Please use the same form as this example: xxxxxx xxxxx_xxx xxxx_xxxx"
echo
echo "Enter the archive you wish to remove from the current archive list: \c"
read VARIABLE in
echo $VARIABLE #>> temp_archive_name
#comm -23 Current_archives temp_archive_name >temp_carchives
#rm -f Current_archives
#mv temp_carchives Current_archives

Worked just fine on my OpenBSD machine using ksh.
 

Cybermastif

Senior member
May 18, 2001
257
0
0
n0cmonkey,

I knew it SHOULD work.... now I just gotta figure out why it is not working for me....

Theorory and practice, you know... lol...

I wonder if it possibally could be an environment variable that is causing it, though I think I can rule that out b/c I can pass a date but not a string...

I don't know.... I'm tired time, for me to hit the sack....
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0


<< n0cmonkey,

I knew it SHOULD work.... now I just gotta figure out why it is not working for me....

Theorory and practice, you know... lol...

I wonder if it possibally could be an environment variable that is causing it, though I think I can rule that out b/c I can pass a date but not a string...

I don't know.... I'm tired time, for me to hit the sack....
>>



I didnt say it should work, just that it did. Are you using ksh or pdksh? Are you sure you set that correctly? Try and find out which version and Ill see if I can find that version for OpenBSD and try it out.