#!/bin/bash TMP_FILE=$(mktemp) # 3) Call the external script and capture output # adjust the path (“../add_smb_user.sh”) as needed TMP_OUT=$(mktemp) bash ./../list_smb_users.sh >"$TMP_OUT" 2>&1 # 4) Display the result (use --msgbox for short, --textbox for multiline) dialog --backtitle "SMB Users" \ --title "SMB Users" \ --textbox "$TMP_OUT" 20 60 rm -f "$TMP_OUT" # dialog --msgbox "User '$USERNAME' with given password would be created." 8 50 rm -f "$TMP_FILE"