0

I am trying to display a huge .txt file using whiptail,but encountered an error

bash: 
/bin/whiptail: Argument list too long

Command Executed:

whiptail --title "Licensing Info" --yesno "`cat /file/location/LICENSE.txt`" --scrolltext 50 100 --yes-button Accept --no-button Reject --fb

I also tried to use --textbox but I am unable to provide yes or no button in the whiptail command.

Suku Ranga
  • 21
  • 3

1 Answers1

1

Apparently it looks like the bash shell argument exceeded the max character, thats the reason I guess, "Argument list too long" error.

I did a workaround and resolved my problem:

if(whiptail --title "Licensing Info" --textbox "/path/to/file/location/LICENSE.txt" --scrolltext 25 75 --ok-button "Proceed to confirm" --fb); then
    if(whiptail --title "Licensing Info" --yesno "Please confirm to install the update" --scrolltext 25 75 --yes-button Accept --no-button Reject --fb); then
        echo "Accepted"
    else
        echo "Rejected"
        exit 0
    fi
else
    echo "Rejected"
    exit 0
fi

Hope this will help if someone encounter this kind of a problem.

Suku Ranga
  • 21
  • 3