thanks ozo ..but I still get error messages:
{cs1:~/unix/hw1} dosort.sh in.txt
input in in.txt will be proccessed now.
./dosort.sh: i: not found
./dosort.sh: syntax error at line 10: `i=$' unexpected
{cs1:~/unix/hw1}
Main Topics
Browse All TopicsHi Experts,
I need some help, I want to read a file and store each line as an item in the array.
Thanks
Hussain
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
this is the output : ( I need to make this in bash)
-r-xr-xr-x 1 root bin 732556 May 2 2007 /bin/bash
-r-xr-xr-x 2 root bin 151456 Aug 8 2006 /bin/csh
-rwxr-xr-x 1 root other 23880 Jan 22 2005 /bin/glib-genmarshal
-rwxr-xr-x 1 root other 703 Dec 16 2004 /bin/gnome-autogen.sh
-rwxr-xr-x 1 root other 329388 Feb 6 2006 /bin/gnome-panel-screensho
-r-xr-xr-x 17 root bin 134 Jan 21 2005 /bin/hash
-rwxr-xr-x 1 root other 283652 Dec 15 2004 /bin/jdshelp
lrwxrwxrwx 1 root root 13 Aug 14 2007 /bin/jsh -> ../../sbin/sh
-r-xr-xr-x 3 root bin 209312 Aug 8 2006 /bin/ksh
-r-xr-xr-x 2 root bin 151456 Aug 8 2006 /bin/pfcsh
-r-xr-xr-x 3 root bin 209312 Aug 8 2006 /bin/pfksh
lrwxrwxrwx 1 root root 13 Aug 14 2007 /bin/pfsh -> ../../sbin/sh
lrwxrwxrwx 1 root root 5 Aug 14 2007 /bin/remsh -> ./rsh
-r-xr-xr-x 3 root bin 209312 Aug 8 2006 /bin/rksh
-r-sr-xr-x 1 root bin 27780 Jun 11 2007 /bin/rsh
lrwxrwxrwx 1 root root 13 Aug 14 2007 /bin/sh -> ../../sbin/sh
-rwxr-xr-x 1 root sys 29992 May 31 2007 /bin/showrev
-r-xr-xr-x 1 root bin 257316 Jun 6 2007 /bin/ssh
-r-xr-xr-x 1 root bin 87744 Jun 6 2007 /bin/ssh-add
-r-xr-xr-x 1 root bin 70912 Jan 22 2005 /bin/ssh-agent
-r-xr-xr-x 1 root bin 87792 Jan 22 2005 /bin/ssh-keygen
-r-xr-xr-x 1 root bin 156092 Jun 6 2007 /bin/ssh-keyscan
-r-xr-xr-x 1 root bin 363520 May 2 2007 /bin/tcsh
lrwxrwxrwx 1 root root 14 Aug 14 2007 /bin/zsh -> ../sfw/bin/zsh
Business Accounts
Answer for Membership
by: ozoPosted on 2008-02-23 at 11:59:48ID: 20966382
while read line
do
input[$i]=$line;
i=$(( $i + 1 ))
done
echo ${input[*]}