please use code tags for code and terminal output.
like this:
Code:
if [ $(( $actmin - $loginmin )) -lt 0 ]; then
ttimehr=$(( ($acthr - $loginhr) - 1 ))
ttimemin=$(( ( $actmin + 60 ) - $loginmin ))
(...)
./timeOn1: line 45: 49 - 47
1
39 : syntax error in expression (error token is "1
39 ")
since you post only part of your script we do not know if the error message refers to the bit you posted.
but anyhow.
your code is very convoluted, too many brackets.
try this:
Code:
if [ $(( actmin - loginmin )) -lt 0 ]; then
ttimehr=$(( acthr - loginhr - 1 ))
ttimemin=$(( actmin + 60 - loginmin ))
are all the variables initialized with numerical values?
would it be possible to post the whole script instead, or a working example that can reproduce the problem?
is this bash?
have you tried
???