Bash ダイアログボックスが終了します。

Bash ダイアログボックスが終了します。

ダイアログボックスを持つbashスクリプトがあります。--checklist

OKとボタンが付属していますcancel

を押すとcancelスクリプトが終了し、シェルに戻ります。

cancelボタンを削除したり、ユーザーがシェルに入らないようにするにはどうすればよいですか?

    #!/bin/bash
set -e
rm -f /tmp/output
rm -f /oke/harddisk
rm -f /tmp/hdbron1
rm -f /tmp/hdbron2
output=`echo /tmp/output`
hd1=/tmp/hdbron1
hd2=/tmp/hdbron2
hd3=/tmp/output

#lsblk -d -e 11,7 -dio size,model | sed 1d | awk '$1=$1' | tr " " "_" | sed -e "s/$/ \/\  /"> /tmp/hdbron2
lsblk -d -e 11,7 -dio size,model | awk '!($1 ~ "M")'| sed 1d | awk '$1=$1' | tr " " "_" | sed -e "s/$/ \/\  /"> /tmp/hdbron2
lsblk -d -e 11,7 | grep "disk" | awk '!($4 ~ "M")'| awk '{print $1}' > /tmp/hdbron1
paste $hd1 $hd2 | paste > /tmp/output

dialog --checklist "Selecteer doel schijf:" 60 90 60 \
$(cat /tmp/output) 2>/oke/harddisk

ベストアンサー1

読んでみましたか?ダイアログボックス文書

--nocancel その仕事をしているようなものが一つあります:

--nocancel
    Suppress the "Cancel" button in checklist, inputbox and menu box modes. A script can still test if the user pressed the ESC key to cancel to quit. 

おすすめ記事