LinuxQuestions.org
Help answer threads with 0 replies.
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 06-15-2009, 02:43 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Rep: Reputation: 30
A simple script that can scroll down a list and select one line.


Hello, I want to create a very simple (if possible) script that can take a list of files from a directory and put them in a list and let me select one of them from the list and then run a command on that one file.

An example is that i have 50 images in a single directory.
I want to run the script and then see a list of the images' file names and then be able to press the up or down buttons on the keyboard and then press enter on the one i want to run my command on (image magick resize).

Another example is for removing back files. I have a bunch in a directory and i like to remove them every now and then. If i could run this script and select the backup file i want to delete from the list, that would be great. I figure i'd have to modify that script so that it knows what command to do on the selected item, but how do i get to that list in the first place?

Can someone point me in the right direction on this one?

-Thanks
 
Old 06-15-2009, 03:09 PM   #2
lcole
Member
 
Registered: Aug 2003
Location: Oregon
Distribution: Ubuntu
Posts: 51

Rep: Reputation: 18
That doesn't sound like a simple script but it would be an interesting exercise.
If you are realy looking for the functionality then you want a File manager. There are many that use just the command line and others for a GUI interface.
See some examples here.
http://www.linux.com/archive/articles/113952
 
Old 06-15-2009, 03:17 PM   #3
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
I am not sure a filemanager will work. The file manager would work for things like deleting files, but not the image stuff. I want to be able to do this all through command line and want to keep it simple so that i can tailor it to many different things.

While it may not be a super simple script, maybe someone can locate one that does this and i can modify it to make it my own.

-Thanks
 
Old 06-15-2009, 03:34 PM   #4
lcole
Member
 
Registered: Aug 2003
Location: Oregon
Distribution: Ubuntu
Posts: 51

Rep: Reputation: 18
Midnight Commander for one looks to be extentable enough for your request. See the following excerpt from http://www.ibiblio.org/mc/FAQ

6.5 Is there any way to include additional options or hot keys to MC?

Yes, F2 invokes an user menu, which is fully configurable. You can
add any shell commands to the user menu. See the mc(1) man page for
more info.

Another way to add functionality is the external panelize feature.
See the mc(1) man page for more info.
 
Old 06-15-2009, 03:43 PM   #5
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
MC seems like it "could" work, but it is pretty complex if you're not used to command line base file managers, especially if i'm expecting others to use this. That is why my original idea was to go with a few scripts that i could create. It'd be very easy for others to run them.

-Any other ideas?
-Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Simple Script To List Groups In Passwd File Output On Linux And Unix LXer Syndicated Linux News 0 04-21-2009 07:20 AM
simple php script to add line/file to text file dnoy Programming 1 05-21-2008 05:08 PM
Bash script: how do I select second-to-last argument in a list Robert S Linux - Software 2 11-23-2007 03:06 PM
Simple bash script "unexpected end of line error" snowman81 Programming 11 11-11-2007 09:31 AM
how to create a simple script for installing a list of files zbenjudah Debian 28 04-16-2007 03:03 PM

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

All times are GMT -5. The time now is 04:32 AM.

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