[Ilugc] File operations using shell script

  • From: cyborg4k@xxxxxxxxx (Shakthi Kannan)
  • Date: Tue Jun 14 20:21:10 2005

Hi,

--- RAJ <rajkumar_chunkymails@xxxxxxxxxxxxxx> wrote:

       I need to do file operation using shell
scripts. I need to 
open a file , read the contents of file to an array
and close the 
file. 

Something like this?

#!/bin/bash
# Usage: file.sh filename
array=( `cat $1` )
echo "${array[@]}"

Not the best example. But, what are you actually
trying to accomplish?

SK

--
proudly anti-micro$oft
--------------------------------------------------------------------------
Shakthi Kannan, MS
Software Engineer, Specsoft (Hexaware Technologies)
http://www.shakthimaan.com
(91) 98407-87007 (M)
--------------------------------------------------------------------------

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com ;

Other related posts: