Creating Command Line Menus with Shell Scripts

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 36

  • @jonchellis2978
    @jonchellis2978 3 роки тому

    Still useful in 2021. Used this to build out a menu to give controlled and simplified access to a new appliance of ours. Thanks!

  • @earnestredwood4694
    @earnestredwood4694 4 роки тому

    This is great thank you for all that you teach up with Linux. I am still learning and it never ends.

    • @theurbanpenguin
      @theurbanpenguin  4 роки тому

      Thanks you sir! You are very kinf to make a comment and I appreciate it Earnest

  • @byteman
    @byteman 10 років тому +8

    Nice, thanks! Been looking for something like this for a long time. Not being proficient in bash scripting, I appreciate the head-start. One suggestion if your menu is going to use 1 character input (number or letter), perhaps change the "read answer" command to: read -n1 -p "Your Choice:" answer (no [Return] required)

  • @meiowalot7570
    @meiowalot7570 5 років тому

    At 6:10 or so, 4,18> is a simpler, more direct way to indent code. It seems like overkill to use a regex and s/// to indent contiguous lines of code, so a pattern match and replace just isn't needed.
    Also, I think if you want a couple lines between the choices and the prompt, a couple of echo statements all by themselves is more straightforward than the echo -e "
    ", e.g.:
    echo
    echo
    I would also use read statements in place of the two prompts using the echo -n (text) because I think it is more readable and easy to understand expressed as:
    read -p "Enter your selection " answer
    ...
    read -p "Enter return to continue" input

  • @jentr5685
    @jentr5685 3 роки тому +1

    If I want the users to enter both Uppercase and Lowercase alphabet for the menu selection, what should I put before the ) to instead? Thx.

  • @DDBAA24
    @DDBAA24 5 років тому +3

    This Bob here , he's been sharing his password with me , lol

  • @derSchmidi
    @derSchmidi 8 років тому

    Excellent guide! That was soo helpful like so many of your videos. Great job!

  • @plasticinthetree4261
    @plasticinthetree4261 4 роки тому +1

    Nice! The "Enter return to continue" works great for commands like "who" that need to print to the screen, but my menu also launches graphical apps like firefox, audacious, etc, and it sucks to have to hit return after closing them in order to continue. How can I structure my script so that I see the output for commands like who and cal, but does NOT call for entering return when launching gui apps? Thanks

  • @mx22a
    @mx22a 10 років тому

    Thank you very much! Follow your video I build a little script to use a list of online FM stations using mplayer for it. I just add a line with a timer sleep on the script. Nice!

  • @10thDoctorLove
    @10thDoctorLove 8 років тому

    This is absolutly fantastic. Thank you so much for doing it :)

  • @adriansrealm
    @adriansrealm 11 років тому

    It really should have a default condition in the event the user enters something other than the three things the menu has handlers for.

  • @j99mac
    @j99mac 4 роки тому

    dose the trap and control c work on osx Mac?

  • @vincentpham7445
    @vincentpham7445 7 років тому +1

    I really fond of the vi substitution vi tricks that you perform, can you make a video that explain the trick? It's will be helpfull for anyone when they work on shell programming environment.

  • @Trevs-Shed
    @Trevs-Shed 11 років тому

    Can the commands that you put in the menu only be commands that the particular user would usually have permission to carry out.?
    Or could I, for instance set a menu option that only myself as root would usually be able carry out.

  • @DBINB-sw3ow
    @DBINB-sw3ow 5 років тому

    love you brother >> you solve my big problem love you again

  • @AwesomeBob
    @AwesomeBob 11 років тому

    Love the videos, but can you do some volume leveling going forward? It's always brutal during the intro then quieter during the content portion of the video.

  • @karakurt7876
    @karakurt7876 4 роки тому +1

    Whoah, sound is hurting.... Otherwise great one, thanks! I wasted a lot of time searching this topic

    • @karakurt7876
      @karakurt7876 4 роки тому

      Nope, wrong again... I'd love to see same thing, but with arrow keys navigation

  • @Asimov16
    @Asimov16 7 років тому

    Would there be any point, pointing out your mistakes in a video, as you are not really going to hear us LOL. PS what editor are you using. I tried this in nano, but some things don't work

    • @turk0lu373
      @turk0lu373 7 років тому

      seems to be using vi. comes with every distro, has a lot of options. check it out

    • @Asimov16
      @Asimov16 7 років тому

      Thanks. I got it to work in nano in the end, once I understood what was going on

  • @kencheng2929
    @kencheng2929 4 роки тому

    Awesome stuff

  • @sinistergeek
    @sinistergeek 6 років тому

    very helpful video!!

  • @BrutusPalmeira
    @BrutusPalmeira 5 років тому

    That penguin from the hood...

  • @jimbo8743
    @jimbo8743 4 роки тому

    Good stuff

  • @gregorychamekh8143
    @gregorychamekh8143 4 роки тому

    fantastic!

  • @EtwBiz
    @EtwBiz 3 роки тому

    You da bomb 💣

  • @MagicalCritical
    @MagicalCritical 2 роки тому

    15>>

  • @jamescobb2618
    @jamescobb2618 5 років тому

    Pengdeliciousness...

  • @sciencelover3558
    @sciencelover3558 5 років тому

    Please don’t use white it hurts my eyes 👀