I have been studying bash recently.

I need a bash code that displays a list of files in the current directory and prompts for which file to execute.

If the user enters a valid choice, then the executable file selection should be invoked.

link|improve this question
Please show some effort. If you've been studying bash, then you must have at least some progress toward a solution? – Andrew Schulman Nov 17 '11 at 10:21
1  
Well, there's their previous question: select files from a set. – slhck Nov 17 '11 at 10:27
-1 Question does not show any research effort. – Daniel Beck Nov 17 '11 at 11:03
Neither did the previous one, 5 hours prior. Vote to close. Again. @user105716, please come back when you get stuck, not when you get started. – Paul Nov 17 '11 at 12:34
feedback

closed as not a real question by Paul, Diogo, Sathya Nov 17 '11 at 14:36

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. See the FAQ for guidance on how to improve it.

1 Answer

To get you started, look up these constructs in the bash manual.

select file in *

if [[ -x "$file" ]]

exec "$file"
link|improve this answer
heh, looks a little like SQL, I thought you were kidding for a moment, i'll have to study bash a bit again too! – barlop Nov 17 '11 at 13:55
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.