I don't
speak ksh, but I like to puzzle
Here is the result of massive guessed translation to bash:
#!/bin/bash
E_WRONGARGS=42
lines=-1
case "$1" in
"" )
lines=50;;
*[!0-9]*)
echo "usage: " `basename $0` file-to-cleanup
exit $E_WRONGARGS;;
*)
lines=$1;;
esac
echo $lines
and here is the result:
Some problems:
'case' has to be lowercase in bash.
# introduces a comment
The echo statement contains an opening " which is never closed.
We don't know what is 'E_WRONGARGS' - probably a numeric errorcode, but where defined? A system-setting? Something ksh knows?
Well - you ask what's the output.
The output depends on the input.
If the 1. parameter ($1) is a positiv integral number, lines is this number.
If there is no parameter at all, lines is 50.
If the 1. parameter is something else, lines is undefined.
The output might be what you see on the screen, which is nothing, or the usage-message.
The output might be a return-code, which is either E_WRONGARGS or 0.
But since 'lines' is never used, I guess this is only part of a bigger script.
The usage-message is puzzling me.
It claims to call the script
SCRIPTNAME file-to-cleanup.
But parameter 1 has to be an integer, so the filename has to be 17 i.e.?
conclusion:
I guess this is only a part of a script, but it is broken too, no matter what the rest of the script might be.
But I don't speak ksh and might be wrong.