Sample Header Ad - 728x90

bash dialog prevent exit

-1 votes
1 answer
2275 views
I have a bash script with dialog --checklist This comes with an OK and cancel button. When I press cancel, the script exits and returns to shell. How do I remove the cancel button or prevent the user to enter shell?
#!/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
Asked by wjp79 (107 rep)
Oct 8, 2019, 02:07 PM
Last activity: Jun 14, 2023, 01:02 AM