A simple script that can scroll down a list and select one line.
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.