kiritosec
kiritosec

Reputation: 1

bash script wont load what am i doing wrong?

this is my code and it does literally nothing when i type "bash nakriin" this is supposed to be a test for my database and its not working please help

ive tried to run it and it does nothing... ive tried looking at other code and it does nothing

#!/bin/bash

menu() {

tput setaf 1; echo "1: Discord"
tput setaf 1; echo "2: randoms"
tput setaf 1; echo "3: instagram"
tput setaf 1; echo "4: facebook"
tput setaf 1; echo "5: snapchat"
tput setaf 1; echo "6: gmail"
tput setaf 1; echo "7: phone number"
tput setaf 1; echo "8: ps4"
tput setaf 1; echo "9: xbox"
echo " "
read -p $'tput setaf 1; echo "choose one:"' option

if [[ $option == 1 ]]; then
echo "1"

elif [[ $option == 2 ]]; then
echo "2"

else
printf "\e[1;93m [!] Invalid option!\e[0m\n"
menu
fi
}

does nothing it looks like it only clears

Upvotes: 0

Views: 40

Answers (1)

Sudosu0
Sudosu0

Reputation: 157

Simply call your menu function after it is loaded

!/bin/bash

menu() {

tput setaf 1; echo "1: Discord"
tput setaf 1; echo "2: randoms"
tput setaf 1; echo "3: instagram"
tput setaf 1; echo "4: facebook"
tput setaf 1; echo "5: snapchat"
tput setaf 1; echo "6: gmail"
tput setaf 1; echo "7: phone number"
tput setaf 1; echo "8: ps4"
tput setaf 1; echo "9: xbox"
echo " "
read -p $'tput setaf 1; echo "choose one:"' option

if [[ $option == 1 ]]; then
echo "1"

elif [[ $option == 2 ]]; then
echo "2"

else
printf "\e[1;93m [!] Invalid option!\e[0m\n"
menu
fi
}


menu

Upvotes: 1

Related Questions