F.S.M. - Folder Selection Menu - Version 1.20

F.S.M. - Folder Selection Menu is a bash script that displays the folders in the default folder (works with openSUSE 12.3). It allows the selection of any listed folder, where upon it will list the folders in the newly selected folder. You can select any folder or backup one folder. You can also request a directory listing of the present folder.

Version 1.10 now displays folder names in columns. Which allows more folders to be be displayed on the screen.
Version 1.11 eliminated the … option when in the root / system folder.
Version 1.12 fixed a root folder display issue, added in more comments.
Version 1.14, which just skipped over 1.13, adds more comments and corrects some misspelled words.
Version 1.20 adds in COLOR which can be turned off, you can now view .hidden folders as true/false/only. You can turn hidden folders on and off when you start fsm.

Just type in . fsm -h for more information.

When you exit F.S.M., you will find you are in the new default folder you selected while in the fsm bash script. So you can use fsm to change your default folder in a terminal session by just selecting a folder from a list of folders. A much easier way to fly (navigate folders) in a terminal session I would say. Try it, you will like it!!

Copy and Paste the text of this script into a text editor and save it as the file fsm in your home area bin folder (~/bin/fsm). The script has become too large to be posted in a message here and is now included in SUSE Paste.

F.S.M. - Folder Selection Menu - Version 1.20

Open the above Link in a new Tab. Select the Download option in the top right and then select Open With Kwrite or other text editor and then save the bash script text file as ~/bin/fsm. It is possible to directly download fsm using the following terminal command (You must delete the old copy of fsm first):

rm ~/bin/fsm
wget -nc http://paste.opensuse.org/view/download/53978354 -O ~/bin/fsm

This script must be marked executable to be used. Please run the following Terminal command:

chmod +x ~/bin/fsm

It is even possible to string all three of these commands together as one. Copy the following command, open up a terminal session, paste it in and press enter:


rm ~/bin/fsm ; wget -nc http://paste.opensuse.org/view/download/53978354 -O ~/bin/fsm ; chmod +x ~/bin/fsm

In order to run fsm, open up a terminal session and type in the following command:

. fsm

Notice that you type in dot <space> fsm which is not so normal. Placing a dot <space> in front of fsm allows it to change your default folder after you exit the script. Normally, running a script spaws a new shell and the default folder will be lost when that script ends. Notice that there is only one exit command in fsm, which is used when you run fsm without the dot <space> as required. When using the dot <space> command, using an exit command anywhere else would cause the terminal session to close when run from a desktop like KDE or GNOME. While fsm is not complex, it shows how several interesting tasks are performed and thus might be useful in another script that you might write.

As always, I would love to hear any comments on fsm that you might have.

Thank You,

Blogs: asroot : Bash : Packet Filter : C.F.U. : GPU’s : fewrup : F.S.M. : H.I. : nVIDIA : LNVHW : N.S.F. : S.A.K.C. : MMCHECK
S.A.S.I. : S.C.L.U. : S.G.T.B. : S.K.I.M. : S.L.A.V.E. : S.L.R.C. : S.T.A.R.T. : S.U.F.F. : SYSEdit : systemd : YaST Power

Hi James,

Nice piece of work. I personally think you could make your scripts prettier by using the possibilities of tput and it’s options, for example to highlight/inverse the selected folder. I used to use tput a lot when working on UNIX System V, no X, to make scripts users could use themselves instead of having to ask the admin, which was me.

I agree completely Knurpht about tput and I have used it for color in several other scripts, but it is hard to tell how much interest might exist in something like this one, but if requested I can do it. When I find an idea like doing a folder listing, I have fun trying to see how far I can take it. Basically, I don’t like to type in long names or sort through large list to find something. Of course you can use your mouse to copy a name, add in CD and paste in the folder name, but even in a terminal prompt, there must be a better way. As for fsm, I have thought of adding in a toggle for hidden folders as well. But again, is there someone that actually uses such a thing like fsm? In any event, I always appreciate your feedback. If no better idea comes to my head this weekend, I will try to improve fsm. As always I do accept requests, but I really must understand and to be to do the required tasks manually on my PC before I could take a suggestion too far and write a good script.

Take a look at http://forums.opensuse.org/blogs/jdmcdaniel3/s-l-r-c-suse-local-repository-creator-example-setup-packman-59/ I called SLRC which deano_ferrari put in a request for. While I was able to deliver, he had to do a lot of ground work to help me understand how to create a local repository manually. We had messages go back and forth like you can not believe, but finally, the task sunk in and I was able to turn it into a bash script. So, you have a request, can do it manually and feel up to explaining it to me, wait till you see what I can do with something I really understand. Anyway, it is always a thought to keep in mind and as always I appreciate your comments!

Thank You,