alhassani54
Programmer
Hi
I have a text file "abc" and I would like to read it.
the "abc" text file is
----------------------
abc
def
ghi
the script is
-------------
#! /bin/ksh
#
integer count=0
export count
exec 0<abc
until (( count==3 ))
do
read line
if [[ $count = 0 ]]; then a=$line; fi
if [[ $count = 1 ]]; then b=$line; fi
if [[ $count = 2 ]]; then c=$line; fi
((count+=1))
done
print $a
print $b
print $c
# End of script
When I run the script I get
abc
def
ghi
Is there a way to simplify the script to read the text file?
All help will be appreciated.
I have a text file "abc" and I would like to read it.
the "abc" text file is
----------------------
abc
def
ghi
the script is
-------------
#! /bin/ksh
#
integer count=0
export count
exec 0<abc
until (( count==3 ))
do
read line
if [[ $count = 0 ]]; then a=$line; fi
if [[ $count = 1 ]]; then b=$line; fi
if [[ $count = 2 ]]; then c=$line; fi
((count+=1))
done
print $a
print $b
print $c
# End of script
When I run the script I get
abc
def
ghi
Is there a way to simplify the script to read the text file?
All help will be appreciated.