Sunday, May 24, 2020

bash read file line-by-line



while read line || [ -n "$line" ]; do 
  line=$(echo $line | tr -d '\r')
  echo $line
done < inputfile.txt

# explain


# tr -- translate

cat file | tr -d '\r'    # delete new line

echo $companyname | tr ' ' '_'



Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home