LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-25-2004, 12:05 PM   #1
Beppe83
Member
 
Registered: Mar 2004
Posts: 41

Rep: Reputation: 15
Bash Programming Advice


Hi!

I have to program a little bash script for school, but I don't really know how and they haven't teach us how-to; well that is what I have to do:

create an interface where it displays the current file/folder in a directory ok? Well I must add some option that the user can select by pressing 1, 2, ... ok? These options are:

- go to up folder
- see only folders or files
- order files or folders by name, date
- see only first n files / folders

I need help from someone who knows bash scriping...and I'm sure you know it...I really appreciate this!

ThanX!
Beppe
 
Old 05-25-2004, 12:22 PM   #2
Nis
Member
 
Registered: Jul 2003
Location: Virginia
Distribution: Ubuntu Hoary (5.04)
Posts: 550

Rep: Reputation: 31
Check the Advanced Bash Scripting Guide for a lot of help. You can use basic Bash scripting or you could use curses (Google for that). If you really want to impress your Prof., and you've got GNOME and zenity on the target machine, you could use zenity to make GTK dialogs. I wouldn't advise turning only a zenity-based thing in, however, because zenity would make it too easy to do everything you ask.
 
Old 05-25-2004, 12:27 PM   #3
vinay_s_s
Member
 
Registered: Jul 2003
Posts: 659

Rep: Reputation: 30
also try this:

man bash
man ls
man for
man do
...... a never ending list
 
Old 05-25-2004, 12:45 PM   #4
drjekyll
LQ Newbie
 
Registered: May 2004
Location: Uruguay
Distribution: Linux Red Hat 9.0
Posts: 5

Rep: Reputation: 0
If you want to create a simple bash menu (command line), I think that you may want to follow that:

Print a screen with options. (see "man echo")
Wait what user type (see "man read")
(also see "man while") -"while :" is always true-
do the option's action and print menu again -see man's posted before-

Advanced Bash Scripting Guide are very powerfull, but too hard. O'rreily Learning the bash shell are basic.
Good luck
 
Old 05-25-2004, 04:11 PM   #5
Beppe83
Member
 
Registered: Mar 2004
Posts: 41

Original Poster
Rep: Reputation: 15
Oh thanks men! Tomorrow I will begin writing down some code!!

I appreciate this!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to write a Bash Shell any advice? CyberEd55 Programming 3 05-12-2005 01:52 PM
Problem in learning programming : (need an advice ) MinA Programming 1 11-14-2004 05:24 AM
Seeking advice on bash script satimis Programming 6 10-11-2004 11:01 AM
http protocol/programming advice... Scrag Programming 2 06-20-2004 10:00 PM
Programming Advice (Text Editor) petercool Programming 5 07-13-2002 11:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration