Link to home
Start Free TrialLog in
Avatar of pillmill
pillmill

asked on

shell script to reads lines of a file ?

The following script should read lines of the input file, but just
returns the file name. How do I get it to read the lines of the file,
one at a time ?

#! /bin/csh

set f = $1

foreach d ( $f  )

echo  $d

end
Avatar of ozo
ozo
Flag of United States of America image

#!/bin/bash
f=$1
while read d ; do
  echo  $d
done < $f
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial