0
我可以直接從命令行awk該文件,但是當我嘗試從腳本中使用它時,它會中斷。不知道爲什麼。我的腳本Bash腳本,返回awk:無法打開文件〜/ .ssh/config
#!/bin/bash
ssh_config_path="~/.ssh/config"
echo -n "Enter the username of the account you'd like to switch to > "
read username
awk '
!x{x=sub(/github-secondary/,"github.com")}
!y{y=sub(/github\.com/,"github-secondary")}
1' $ssh_config_path
你從哪裏使用'$ username'命令? – Cyrus
還沒有使用過它 –