Results 1 to 2 of 2

Thread: please can someone help

  1. #1
    Join Date
    Mar 2013
    Beans
    2

    please can someone help

    hi i'm new to this and i was wondering if anyone could help me. i want to make a menu style shell script that will let me backup, restore and quit and i have no idea how to even start. I've read many tutorials but it goes over my head hope someone can help. i really haven't a clue what to do to even start writing this and would love to learn. surely someone knows how to make one like this

  2. #2
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,430
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: please can someone help

    menu can be done with select

    Code:
    select choice in "backup" "restore" "quit"
    do
      echo "you selected '$choice'"
      case $choice in
        backup)  echo do backup things here
                 ;;
        restore) echo do restore things here
                 ;;
        quit)    echo quit
                 exit 0
                 ;;
      esac
      break  # jump out of the otherwise infinite select loop.
    done
    how it would look like:
    Code:
    1) backup
    2) restore
    3) quit
    #? 1
    you selected 'backup'
    do backup things here
    and when it comes to backing up, look at rsync command
    Last edited by Vaphell; March 26th, 2013 at 10:22 PM.
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •