如何合并以下两个案例脚本?
脚本 1
#!/bin/bash
Ver=0
n="192.168.1.20:/backup/b1"
o1="192.168.1.20:/backup/b2"
User="1234"
echo "n Latrest version"
echo "o1 Previous version n-1"
echo "o2 Previous version n-2"
echo -n "Which version you want to backup [n or p]? "
read Ver
case "$Ver" in
(n|o1|o2) scp $User@${!n} . ;;
(*) echo "UNKNOWN USER"
esac
上面的脚本不能正常工作错误
cannot stat `1234@': No such file or directory
脚本 2
User=0
av="34567"
ma="4568"
im="5678"
mi="12345"
pr="23456"
echo "Please select av ma ji im pr"
echo -n "First 2 initial of your Name eg: [av ma ji im pr]? "
read User
case "$User" in
(av|ma|pr|mi|im) scp ${!User}@$n . ;;
(*) echo "UNKNOWN USER"
esac