I wrote a really simple file explorer using ls with a shell script. I used a while loop to make the script run forever (until Ctrl+C), but the while loop doesn't seem to work. I get this error
./fileexplorer: line 5: syntax error near unexpected token `done'
./fileexplorer: line 5: `done'`
My code is this:
#!/bin/bash
ls -l $1
while :
browse()
done
function browse()
{
read file;
if [ -f $file ]
if test -e $file
echo "Starting $file with nano."
echo "Press a key to open the file."
pause
nano $file
if test -d $file
ls -l $file
}