Contents
How do you subtract time in Unix?
Subtract two rows (in Time format)
log | grep -v ZZZ | awk ‘{print $1 ” ” $2 “;” $3 “;” $9 “;” $11}’ > myfile. csv sed -i ‘1iDate;Time;From;To’ myfile. csv => it is clear that it converts log to csv and add a header.
How do you subtract in Shell?
The following arithmetic operators are supported by Bourne Shell.
…
Unix / Linux – Shell Arithmetic Operators Example.
| Operator | Description | Example |
|---|---|---|
| – (Subtraction) | Subtracts right hand operand from left hand operand | `expr $a – $b` will give -10 |