keep it simple version:

fileSelect.sh

#!/bin/bash
select FILENAME in *;
do
        echo "You picked $FILENAME ($REPLY), it is now only accessible to you."
        chmod go-rwx "$FILENAME"
        break;
done

bash linux file select output terminal

 

creditz: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_06.html

cool grafical but not working-right version:

while this does very beautiful menus… somehow it did not „work“ right (did not find any files?)
could not modify default dir… anyway.

fileDelete.sh

bash linux file select output terminal2

#!/bin/bash
# deletefile.sh - Remove the file using dialog box
# -------------------------------------------------
# purpose - remove file
#  $1 - filename
function delete_file(){
	local f="$1"
	local m="$0: file $f failed to delete."
	if [ -f $f ]
	then
		/bin/rm $FILE && m="$0: $f file deleted."
	else
		m="$0: $f is not a file."
	fi
	dialog --title "Remove file" --clear --msgbox "$m" 10 50
}

# select filename using dialog
# store it to $FILE
FILE=$(dialog --title "Delete a file" --stdout --title "Please choose a file to delete" --fselect /script/test/ 14 48)

# delete file
[ ! -z $FILE ] && delete_file "$FILE"

creditz: http://bash.cyberciti.biz/guide/The_file_selection_box

admin