我只找到了这样的东西
python3 -m pdb myscript.py
但它不做什么
set -x
执行脚本,并在终端上显示用变量的实际值执行的每一行。
例如:
#!/bin/bash
set -x
echo "This is a foo message"
sshpass -p $2 ssh root@$1
echo "this is just argument no3 --> $3 :)"
因此,当您使用参数运行脚本时,您会看到具体完成了什么。
root@notebook:~# ./myscript.sh myserver.com mypassword bar
+ echo 'This is a foo message'
This is a foo message
+ sshpass -p mypassword ssh root@myserver.com
+ echo "this is just argument no3 --> bar :)"
this is just argument no3 --> bar :)