Skip to content

Instantly share code, notes, and snippets.

@quickgrid
Created March 5, 2016 14:31
Show Gist options
  • Save quickgrid/82569a8243f9cf4d531d to your computer and use it in GitHub Desktop.
Save quickgrid/82569a8243f9cf4d531d to your computer and use it in GitHub Desktop.
Shell script for reading from file and passing the data to another script to calculate factorial
#!/bin/bash
# Read from file and send data to another script to calculate.
readAndCalculateData(){
while read input
do
echo "sending $input to Calculate:"
bash factorial.sh $input
done < "$1"
}
readAndCalculateData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment