Okey, lets start with the case.
Yes, you have to shift first, $1 still contains "--file" or "-f" if not shifted.
What shift does is basically just moving $1 to nothing, $2 to $1 and so on. (where $2 and so on is the next incoming parameter seperated by whitespace)
Secondly, i wouldn't use while [ "$1" != "" ]... use either this:
Code:
until [ -z $1 ]; do
case .....
done
(-z says true if variable is null or zero)
or this
Code:
while [ $# -gt 0 ]; do
case ....
done
$# is number of parameters (every time you shift it becomes -1)
in your first IF-statement you should use
Code:
if [ $time -eq 1 ]; then
commands...
fi
Also, the string comparision sign is "==" and not "=". The differance between using sign operators and the ones like -eq is that sign operators are meant to use for strings and the others are used for numbers.
Hope this clarified some things. Still not sure what wouldn't work in your script but the && time ./$file.out thingie looks suspicious to me
Best regards
Fredrik Eriksson