>>==>> Some help with my scripting please.

>>==>> Some help with my scripting please.

Post by trito » Tue, 09 May 2000 04:00:00



Could someone please help me,

I am writing a script file in "ksh"
I want to be able to read the entire contents of a text file
into one variable such as $LIST_TYPE
then when "echo $LIST_TYPE" is runned outside a loop
it displays all elements stored within that variable.
Could some one please provide a example or information?

If this cant be done then what about reading each line into
a separate variable but incrementing that variable name eg.

WHILE read LIST_TYPE
do
(( COUNT = COUNT + 1))
LIST_FINAL$COUNT=$LIST_TYPE
loop < list.txt
echo $LIST_FINAL2

 
 
 

>>==>> Some help with my scripting please.

Post by No Na » Tue, 09 May 2000 04:00:00


On Mon, 08 May 2000 08:00:51 GMT, triton said:

Quote:>Could someone please help me,

>I am writing a script file in "ksh"
>I want to be able to read the entire contents of a text file
>into one variable such as $LIST_TYPE
>then when "echo $LIST_TYPE" is runned outside a loop
>it displays all elements stored within that variable.
>Could some one please provide a example or information?

>If this cant be done then what about reading each line into
>a separate variable but incrementing that variable name eg.

>WHILE read LIST_TYPE
>do
>(( COUNT = COUNT + 1))
>LIST_FINAL$COUNT=$LIST_TYPE
>loop < list.txt
>echo $LIST_FINAL2

LIST=''
while read a_line_in_your_file
do
 LIST="${LIST} $a_line_in_your_file"
done < your_file
echo $LIST

 
 
 

>>==>> Some help with my scripting please.

Post by Xiaox » Tue, 09 May 2000 04:00:00


I would quote whatever with echo. Think about there is a semi colon
in the text.
Thomas


Quote:> Could someone please help me,

> I am writing a script file in "ksh"
> I want to be able to read the entire contents of a text file
> into one variable such as $LIST_TYPE
> then when "echo $LIST_TYPE" is runned outside a loop
> it displays all elements stored within that variable.
> Could some one please provide a example or information?

> If this cant be done then what about reading each line into
> a separate variable but incrementing that variable name eg.

> WHILE read LIST_TYPE
> do
> (( COUNT = COUNT + 1))
> LIST_FINAL$COUNT=$LIST_TYPE
> loop < list.txt
> echo $LIST_FINAL2

 
 
 

1. LILO help <><><><><><>

I just installed RH6 on a box that only had a 50MB DOS partition to
begin with.
During the RH install, I used Disk Druid to set up additional
partitions as follows:
/       ~1 GB
swap    ~40 MB
/usr    ~500 MB
/boot   ~10 MB

When prompted, I told it to install LILO into the "/boot" partition.

Upon restarting the system after the install, it booted into DOS again
from my origional active DOS partition.

I tried booting from the emergency rescue disk that I was prompted to
create during the install, but it gives me an error "0x10" and stops.

I can boot using the RH "boot.img" boot disk, hitting F4, and then
inserting the "rescue.img" disk made from dosutils on the RH CD, but I
have no idea what to do from there.

I want to make the thing boot with LILO and ask whether to start DOS or
boot Linux (as default). I realize now that I probably shoud've just
told it to install LILO into the MBR.

Please tell me there is an easy/painless way to get LILO to do this
without re-installing totally.

Please respond via Email to:  jack972 [<at>] netzero [<dot>] net

Many thanks!

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Connecting to a remote server

3. <><><> MOUNTING EXTENDED PARTITION <><><>

4. "y" cable for nec versa mouse/keyboard ?

5. Wanted: <><><> Unix Specialist <><><>

6. xdm in X11R6/ELF

7. >>---> Software Jobs! >>--->

8. Need TAR file formats...

9. <<->> x-server and backspace: help needed please <<->>

10. ISP -> UUCP -> Linux -> POP/SMTP -> endusers Please Advice

11. HELP: 2>&1 > /dev/null != 2>&- > /dev/null ???

12. lan>eth0>linux>ppp0>inet help thanks

13. Win95/IPX -> IP ->PPP ->Linux ->Novell 3.12