Jump to content

Bash Script ideas


FFE

Recommended Posts

Just looking for some ideas for a cap stone project in my Into to Unix class

Id doesn't have to be to tough, but I don't want have it to easy, I need a challange. I would like it to be useful as well.

So through out some ideas

Link to comment
Share on other sites

What's a "cap stone project"?

I can find the following for "Capstone project":

Usually, the Capstone project is the most ambitious research and writing effort the student has yet undertaken.

So if I'm not mistaken, you're looking for a sort-of bash scripting challenge. You're not particularly familiar with bash scripting, and want to use this project as a fixed target to hone your skill and knowledge to.

How about a somewhat generic and configurable menu?

You log on, and the script presents you with choices, and based on the selection you make it will either show you more choices, or run the command of that given choice. Obviously, the configuration for the menu should be put into a separate file. Bonus points for using color (again, configurable).

Link to comment
Share on other sites

How about a somewhat generic and configurable menu?

You log on, and the script presents you with choices, and based on the selection you make it will either show you more choices, or run the command of that given choice. Obviously, the configuration for the menu should be put into a separate file. Bonus points for using color (again, configurable).

Good advice, I started with small menus when learning to code/script on the Amiga and Acorn Archimedes computers back in the day, taught me a lot :)

Link to comment
Share on other sites

I can script enough to get what I want to do done.

A few things to consider if you feel the task presented to you is too easy:

A screen is expected to be 80x24 in size, but this can change (see the vga= kernel boot option). Now, bash doesn't get any notification about window resizing, so it would be very hard to do this on the fly, but basically your screen drawing routines should simply not make any assumptions on screen size.

Figure out for yourself how you can keep the layout looking nice. If the user puts in an option name of 1000 characters, what do you do? Wrap it? Cut it off? Both options are dependant on screen size (or should be).

How many options will you be able to fit in a screen?

My first ever scripting assignment was for a menu in CSH. It was way easy, but they didn't mind you hardcoding the menu options.

Link to comment
Share on other sites

  • 3 weeks later...

I've recently been doing some bash scripts using sed, awk, grep and wget. Most of these scripts grab pages from the intarweb and display the vital information in a nicely formatted way. Here are some of the scripts I've made:

1. Phonebook - Type in a name and a city, returns the address and phone number of every person with that name in that city.

2. Gas Prices - No input, returns the top 10 cheapest gas stations in my city and their locations.

3. Movie Times - No input, returns the showtimes for the movie theatres close to my home.

4. Movie Cast - Type in the name of a movie, returns the list of cast and characters for that movie. (Great for 6 degrees of Kevin Bacon)

***EDIT***

5. Directions - Type in begin and end location, returns text directions from MapQuest.

***EDIT***

Combine these with MIDPSSH and I've got a cheap and easy way to access important information from my cell phone.

My most recent bash script is also one of my favourites. Inspired by the podcatching script "bashpodder", my script goes to apple.com/trailers and downloads all the latest HD trailers to my media center.

Try scripting these for yourself. I sure learned a lot.

Link to comment
Share on other sites

Yep, all this web-things are fun with bash script because wget is simply far too much powerfull (i've heard it will change lead into gold in the next version, but the pre-alpha only changes it into silver).

I've done a simple "rfc reader" which download an rfc given its number and display it (with less, but you can improve it).

Else, if you want to learn a lot or find ideas, read some scripts in your distro's tools (for example init scripts).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...