qfedu-linux-advanced-level/day1/homework/h6.sh

12 lines
241 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 编写一个Shell脚本接受一个字符串作为参数并将该字符串逆序输出。
# 【提示】 echo "abc"|rev
if [ $# -ne 1 ]; then
echo "请提供一个字符串作为参数"
exit 1
fi
echo "$1"|rev