Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

interactive bash shell program


ghost's Avatar
0 0

I was wondering if some one could point me in the right direction as to how I would program a bash shell program that would be interactive.. like say.. scapy or metasploit (the msfconsole).

Any ideas?? Thanks for any input. :)


ghost's Avatar
0 0

What do you want your script to do exactly?

Oh, and it's unibomber. Uni is a prefix meaning "one" or "single".


ghost's Avatar
0 0

What I'm referring to is say when you enter ./msfconsole .. you are then brought up to the metasploit interactive console.

I was just wondering if this is possible to do with the bash shell, for like making simple text games or what have you.


ghost's Avatar
0 0

Yup, it's possible. Basically, you just need to do this:


read CMD;
echo $CMD;```


Also, here's a tutorial on bash scripting: http://www.linuxconfig.org/Bash_scripting_Tutorial

spyware's Avatar
Banned
0 0

Bourne-again shell shell?

Edit: btw, you don't need to use Bash in order to create fucking console applications/scripts. You can give command-line parameters to virtually every language.


ghost's Avatar
0 0

Well I was thinking of making a text based game that would look something like this:

root@somebox~$ ./game.sh (to run the game)

#################WelcomeToTheGame##################

TheGame>help

createcharacter …………………… create your character etc.. help ………………………………… list help etc etc

TheGame>

Where if you're in the interactive mode you no longer see "root@somebox~$ " because the game is taking control of the full console screen.

I imagine I might need to use stty. Any other ideas?

@Spyware: I'm choosing bash because it's what I'm most familiar with.