私はダイアログを使用するスクリプトファイル(sh-file)をプログラミングしています。私はエラーを探すのに怒っているので、数週間はそれを面倒にしておきたいと思っています。最初のコマンドはなぜ実行されますが、最後の2つではありません(統計とダイアログ)?
必要スクリプト部分注意:
INPUT=/tmp/input.sh.$$ #Just a tmp file used for storing information
FIELDS=/tmp/fields.sh.$$ #Just a tmp file used for storing information
function view_folder_properties() {
dialog --title "Choose a folder to view properties from" --dselect/23 60 2> $INPUT
location=$(<"${INPUT}")
stat $location > $FIELDS
dialog --title "Viewing permissions" --textbox $FIELDS 23 60
}
問題は、コードの最初の2行ではありませんが、私はSTATと、ダイアログを実行したいとき、それはこのようになりますエラーの2行を返します。
./lab-E.sh: line 232: stat: command not found
./lab-E.sh: line 233: dialog: command not found
私はほとんど1〜2時間の問題を探していると、まだ私はあなたの助けを求めています理由です、何の問題を見つけることができません。私のシステム上の$ PATH変数をエコー
は次のようになります。
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/ProgramData/Oracle/Java/javapath_target_98747640:/mnt/c/Program Files (x86)/Razer Chroma SDK/bin:/mnt/c/Program Files/Razer Chroma SDK/bin:/mnt/c/Program Files (x86)/Intel/iCLS Client:/mnt/c/Program Files/Intel/iCLS Client:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files (x86)/IVI Foundation/VISA/WinNT/Bin:/mnt/c/Program Files/Intel/WiFi/bin:/mnt/c/Program Files/Common Files/Intel/WirelessCommon:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files (x86)/GtkSharp/2.12/bin:/mnt/c/Program Files/dotnet:/mnt/c/Users/<USERNAME>/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/<USERNAME>/AppData/Local/GitHubDesktop/bin:/snap/bin
ダイアログおよびSTATパス/ usr/binが
[email protected]:~# which stat
/usr/bin/stat
[email protected]:~# which dialog
/usr/bin/dialog
[email protected]:~#
私の仮定は、これらのバイナリは、販売から実行されたときにあなたの$ PATH上にあるが、あなたのスクリプト環境の$ PATHにはない場所にあるということです。 'which stat'を実行すると、完全修飾パスが表示されます。スクリプトでこれを試してみるか、PATHを調整してください。 –
関数view_folder_propertiesの最後を除いて、スクリプト内のどこにでもコマンドを使用できます。 – Erik
あなたの質問には、スクリーンショットではなくコード形式のテキストとしてコードを含めてください。 –