Bash - Create option menu from files in current directory

#!/bin/bash # Search for Text files ext=".txt" # Create array from files based on extension files=(*$ext) # Option Selector select file in "${files[@]}" do # file path filepath=$PWD"/"$file # file name without extension filename=${file%$ext} # do action echo $filepath # exit the select loop break done;

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.