Created
March 5, 2016 14:31
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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