#!/bin/bash
filename = $2
if [ "$1" = "-cat" ]; then
echo " Displaying the Content of the file:"
filename = $2
cat filename
else
if [ "$1" = "-ls"]; then
echo "Displaying directory listing:"
ls -l filename
else
echo " Commands not correct:"
fi
done
it shows the error
line 14: syntax error near unexpected token 'done'
line 14: 'done'
i am using bash shell in ubantu..
thank you and regards
edit by bakunin: please use CODE-Tags when posting code. It greatly enhances readability and it cheers up the venerable cfajohnson to no end. I have inserted them now for you.
[indent]
When posting code, please do not retype it; insert the script file or cut and paste the code. The previous line would have given you an error if that is what you actually were running.