Open xgqfrms opened 2 years ago
#!/usr/bin/env bash
# echo \\n
echo -e '\n'
echo '$0'=$0
echo '$1'=$1
# echo -e '\n'
printf '\n'
# linux block comments / linux multi-lines comments
# ❌
echo <<EOF
Linux Here Documents
这个多行注释 1
这个多行注释 2
这个多行注释 3
EOF
# ✅
# cat <<EOF
# Linux Here Documents
# 这个多行注释 1
# 这个多行注释 2
# 这个多行注释 3
# EOF
# write 覆盖 >
echo 'hello world 1' > single_output.txt
echo 'hello world 2' > single_output.txt
# write 追加 >>
echo 'hello world 3' >> single_output.txt
echo -e '\n'
# write 覆盖 >
echo "hello world 1" > double_output.txt
echo "hello world 2" > double_output.txt
# write 追加 >>
echo "hello world 3" >> double_output.txt
echo -e '\n'
# clear
# rm -rf single_output.txt
# rm -rf double_output.txt
# var
echo 🅿️ "The path variable is $PATH"
echo -e '\n'
# *
echo 👻 *
echo 👻 *.sh
echo -e '\n'
# path
echo 🚀 ~
echo -e '\n'
# range
echo {1..7}
echo -e '\n'
# "" vs ''
echo ✅ "$(ls -al)"
echo ❌ '$(ls -al)'
echo 👎 $(ls -al)
echo -e '\n'
bash echo 写文件