Linux bash 語法問題 - Linux

By Elma
at 2018-03-12T20:46
at 2018-03-12T20:46
Table of Contents
#!/bin/bash
if [$(cat ~/.bashrc |grep python3)=*'$HOME/python3/bin'*];then
sudo source ~/.bashrc
python3 -V
else
echo ""
echo ""
echo "You need to add \"export PATH=\$PATH:$HOME/python3/bin into
~/.bashrc\""
echo "Then execute \"source ~/.bashrc\""
fi
小弟預期用紅字部分來看 bashrc內有無 python3 字眼 預期不是 空字串就是包含
'$HOME/python3/bin'
但是執行結果卻出現
./python3_install2: line 2: [=*$HOME/python3/bin*]: No such file or directory
不太了解這個錯誤
--
if [$(cat ~/.bashrc |grep python3)=*'$HOME/python3/bin'*];then
sudo source ~/.bashrc
python3 -V
else
echo ""
echo ""
echo "You need to add \"export PATH=\$PATH:$HOME/python3/bin into
~/.bashrc\""
echo "Then execute \"source ~/.bashrc\""
fi
小弟預期用紅字部分來看 bashrc內有無 python3 字眼 預期不是 空字串就是包含
'$HOME/python3/bin'
但是執行結果卻出現
./python3_install2: line 2: [=*$HOME/python3/bin*]: No such file or directory
不太了解這個錯誤
--
Tags:
Linux
All Comments

By Connor
at 2018-03-13T06:33
at 2018-03-13T06:33

By Caitlin
at 2018-03-13T22:16
at 2018-03-13T22:16

By Ursula
at 2018-03-18T15:06
at 2018-03-18T15:06

By Heather
at 2018-03-20T22:52
at 2018-03-20T22:52

By Ethan
at 2018-03-23T14:27
at 2018-03-23T14:27

By Una
at 2018-03-27T08:39
at 2018-03-27T08:39

By Elizabeth
at 2018-03-30T02:28
at 2018-03-30T02:28
Related Posts
apt無法正常使用

By Gary
at 2018-03-10T11:16
at 2018-03-10T11:16
R5 2400G 有合適的linux可以順順跑嗎?

By Michael
at 2018-03-09T20:46
at 2018-03-09T20:46
設定可以使用 su 的使用者?

By Erin
at 2018-03-09T12:52
at 2018-03-09T12:52
mac沒有"有線網路",如何實現yum

By Delia
at 2018-03-09T11:15
at 2018-03-09T11:15
關於mount網路硬碟資料夾的權限

By Kelly
at 2018-03-08T16:14
at 2018-03-08T16:14