Created
September 29, 2015 19:10
-
-
Save forestbaker/db04b018889aa9b0483b to your computer and use it in GitHub Desktop.
DEBUG - write to & read from same file
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
needs file descriptor and something like this | |
exec 10>$temp | |
<$temp> | |
#!/bin/bash - | |
# track path & filename for tempfile | |
temp="./example.tmp" | |
# create a list of files | |
printf "1n2n3n4n5n" > $temp | |
# read lines from tempfile | |
while read input_val do | |
echo $input_val | |
done < $temp # Feeds the temp file into the loop | |
# remove when done | |
rm $temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment