当前位置:首页 > 编程笔记 > 正文
已解决

2023-mac rz sz 安装

来自网友在路上 155855提问 提问时间:2023-11-05 01:03:59阅读次数: 55

最佳答案 问答题库558位专家为你答疑解惑

之前安装过一次,没问题,这次按照之前教程装了就不管上传下载都会卡住;

step1: 

brew install lrzsz

step2:在/usr/local/bin  路径下配置两个sh,之前从网上找到的直接用都不对,下面这个是调试过的正式可用的

iterm2-recv-zmodem.sh

#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.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 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; thenFILE=`osascript -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)&\"\")"`
elseFILE=`osascript -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"/usr/local/bin/rz -E -e -bsleep 1echoechoecho \# Sent \-\> $FILE
fi

iterm2-send-zmodem.sh

#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.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 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; thenFILE=`osascript -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)&\"\")"`
elseFILE=`osascript -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/usr/local/bin/sz "$FILE" -e -bsleep 1echoecho \# Received $FILE
fi

step3: 建立软连接

sudo ln -s /opt/homebrew/bin/sz /usr/local/bin/sz
sudo ln -s /opt/homebrew/bin/rz /usr/local/bin/rz

step4: 配置

item2-preferences-profiles-advanced-triggers

配置信息:

rz配置参数
rz waiting to receive.\*\*B0100
Run Silent Coprocess
/usr/local/bin/iterm2-send-zmodem.sh
✅
✅sz配置参数\*\*B00000000000000
Run Silent Coprocess
/usr/local/bin/iterm2-recv-zmodem.sh
✅
✅

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"2023-mac rz sz 安装":http://eshow365.cn/6-32292-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!