Hi,
I have a KSH script that read lines from input file and process them one by one:
while read line ; do
##############
done < $ConfigFile
I want to make sure, that input line is not comment (#) or empty line; for comment I've come up with
if echo $line | grep '^\#' >/dev/null ;then
#Comment Line
else
#regular line - process
fi
How can I detect an empty line?
I've tried something like
if echo $line | grep '\^\$' >/dev/null ;then ...
But it didn't worked - it took every line...
I have a KSH script that read lines from input file and process them one by one:
while read line ; do
##############
done < $ConfigFile
I want to make sure, that input line is not comment (#) or empty line; for comment I've come up with
if echo $line | grep '^\#' >/dev/null ;then
#Comment Line
else
#regular line - process
fi
How can I detect an empty line?
I've tried something like
if echo $line | grep '\^\$' >/dev/null ;then ...
But it didn't worked - it took every line...