
대화 상자가 있는 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.