⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readpipe.sh

📁 Shall高级编程
💻 SH
字号:
#!/bin/sh# readpipe.sh# This example contributed by Bjon Eriksson.last="(null)"cat $0 |while read linedo    echo "{$line}"    last=$linedoneprintf "\nAll done, last:$last\n"exit 0  # End of code.        # (Partial) output of script follows.        # The 'echo' supplies extra brackets.#############################################./readpipe.sh {#!/bin/sh}{last="(null)"}{cat $0 |}{while read line}{do}{echo "{$line}"}{last=$line}{done}{printf "nAll done, last:$lastn"}All done, last:(null)The variable (last) is set within the subshell but unset outside.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -