板友好
有一個檔案 tunnel_list 內容為
tunnel1
tunnel2
tunnel3
我寫了一個 script: remove_tunnel.sh 內容為
#!/bin/bash
sed -i 's/$1//g' tunnel_list
sed -i '/^$/d' tunnel_list
並在 shell 中丟入參數
./remove_tunnel.sh tunnel1
它無法刪除 tunnel1,因為$在sed中好像代表句尾,請問我參數1在 sed 中
要怎表示呢? 謝謝
--
有一個檔案 tunnel_list 內容為
tunnel1
tunnel2
tunnel3
我寫了一個 script: remove_tunnel.sh 內容為
#!/bin/bash
sed -i 's/$1//g' tunnel_list
sed -i '/^$/d' tunnel_list
並在 shell 中丟入參數
./remove_tunnel.sh tunnel1
它無法刪除 tunnel1,因為$在sed中好像代表句尾,請問我參數1在 sed 中
要怎表示呢? 謝謝
--
All Comments