.design 域名的网站,建设网站要做的工作总结,怎么样做一个个人网站,荆州论坛前言
mac os 终端不支持使用 rz sz 上传下载文件#xff0c;本文提供解决方法。
mac 上安装
brew install lrzsz两个脚本
注意#xff1a;/usr/local/bin/iterm2-send-zmodem.sh 中的 sz命令路径要和你mac 上 sz 命令路径一致。 /usr/local/bin/iterm2-recv-zmodem.sh 中…前言
mac os 终端不支持使用 rz sz 上传下载文件本文提供解决方法。
mac 上安装
brew install lrzsz两个脚本
注意/usr/local/bin/iterm2-send-zmodem.sh 中的 sz命令路径要和你mac 上 sz 命令路径一致。 /usr/local/bin/iterm2-recv-zmodem.sh 中的 rz 命令路径要和你 mac 上的 rz 命令路径一致。 查看 mac 上 rz 和 sz 命令的路径
$ which rz
/opt/homebrew/bin/rz$ which sz
/opt/homebrew/bin/szcat /usr/local/bin/iterm2-send-zmodem.sh EOF
#!/bin/bash
# Author: Matt Mastracci (matthewmastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domainosascript -e tell application iTerm2 to version /dev/null 21 NAMEiTerm2 || NAMEiTerm
if [[ $NAME iTerm ]]; thenFILEosascript -e tell application iTerm to activate -e tell application iTerm to set thefile to choose file with prompt Choose a file to send -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\)
elseFILEosascript -e tell application iTerm2 to activate -e tell application iTerm2 to set thefile to choose file with prompt Choose a file to send -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\)
fi
if [[ $FILE ]]; thenecho Cancelled.# Send ZModem cancelecho -e \\x18\\x18\\x18\\x18\\x18sleep 1echoecho \# Cancelled transfer
else/opt/homebrew/bin/sz $FILE -e -bsleep 1echoecho \# Received $FILE
fi
EOFcat /usr/local/bin/iterm2-recv-zmodem.sh EOF
#!/bin/bash
# Author: Matt Mastracci (matthewmastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domainosascript -e tell application iTerm2 to version /dev/null 21 NAMEiTerm2 || NAMEiTerm
if [[ $NAME iTerm ]]; thenFILEosascript -e tell application iTerm to activate -e tell application iTerm to set thefile to choose folder with prompt Choose a folder to place received files in -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\)
elseFILEosascript -e tell application iTerm2 to activate -e tell application iTerm2 to set thefile to choose folder with prompt Choose a folder to place received files in -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\)
fiif [[ $FILE ]]; thenecho Cancelled.# Send ZModem cancelecho -e \\x18\\x18\\x18\\x18\\x18sleep 1echoecho \# Cancelled transfer
elsecd $FILE/opt/homebrew/bin/rz -E -e -bsleep 1echoechoecho \# Sent \-\ $FILE
fi
EOF给脚本赋予权限
sudo chmod 777 /usr/local/bin/iterm2-*配置 iterm2 注意 Action 列有下拉选项框选择即可。其他列复制粘贴。 为方便复制
Regular expression: rz waiting to receive.\*\*B0100Action: Run Silent CoprocessParameters: /usr/local/bin/iterm2-send-zmodem.shInstant: checkedRegular expression: \*\*B00000000000000Action: Run Silent CoprocessParameters: /usr/local/bin/iterm2-recv-zmodem.shInstant: checked