Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
Last active October 19, 2019 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbvf50mobile/c077f2ee86acc5e72a6c5ab342a88f5c to your computer and use it in GitHub Desktop.
Save lbvf50mobile/c077f2ee86acc5e72a6c5ab342a88f5c to your computer and use it in GitHub Desktop.
@liso_soma task about redirection
echo "alias x='bash 20191020_Sunday/20191020.sh'"
# $ echo "test" | x test.output
# https://stackoverflow.com/a/7045517/8574922
# https://stackoverflow.com/a/28786207/8574922
# https://stackoverflow.com/a/1809910/8574922
# https://stackoverflow.com/a/17336953/8574922
# https://stackoverflow.com/a/17336953/8574922
# https://stackoverflow.com/questions/17336915/return-value-in-a-bash-function
# https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php
function encoder(){
echo "${1}!"
}
while IFS= read -r line
do
line=$(encoder $line)
if [ -z "$1" ]
then
echo $line
else
echo $line >> $1
fi
done
echo "alias x='bash 20191020_Sunday/20191020.sh'"
# $ echo "test" | x test.output
# https://stackoverflow.com/a/7045517/8574922
# https://stackoverflow.com/a/28786207/8574922
while IFS= read -r line
do
if [ -z "$1" ]
then
echo $line
else
echo $line >> $1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment