Search Results

Search: Posts Made By: Brusimm
892
Posted By bakunin
Why you would want to use anything instead of vi...
Why you would want to use anything instead of vi eludes me. ;-))

I suppose it is because gvim - graphically challenged vi-lookalike - detaches itself from the shell it is run in. Therefore the...
7,940
Posted By drl
Hi. The dateutils suite contains a code that...
Hi.

The dateutils suite contains a code that can add date/time durations: dadd. However, the format of the durations needs to be not in a form like 1:51:59, but rather 1h51m59s. That can be done...
7,940
Posted By Don Cragun
Note that I used a Korn shell in post #2 and...
Note that I used a Korn shell in post #2 and itkamaraj used bash in post #3. If you use bash, you will need to strip leading zeros from minutes and seconds values 08 and 09. The Korn shell treats...
7,940
Posted By itkamaraj
#!/bin/bash list="1:11:00 0:13:03 2:06:45" ...
#!/bin/bash

list="1:11:00 0:13:03 2:06:45"

h=0
m=0
s=0
for x in ${list}
do
echo ${x}
h=$(( h + ${x%%:*} ))
Min=$(echo ${x%:*} | cut -d: -f2)
m=$(( m +...
7,940
Posted By Don Cragun
Maybe something more like: #!/bin/ksh ...
Maybe something more like:
#!/bin/ksh
list="1:11:59 0:13:58 2:06:57 1:38:56 1:36:55 0:06:54 0:31:53 0:33:52 0:38:51 0:44:50"

h=0
m=0
s=0
while IFS=':' read H M S
do
h=$(( h + H )) #...
3,149
Posted By agama
Don't confuse the shell variable expansion...
Don't confuse the shell variable expansion substitution syntax with regular expressions because they are (just as confusing at first) and quite different.

For the full list of possibilities have...
8,421
Posted By johna
Actually...
...this is an issue with shell quoting.

In my original reply which mistakenly used double quotes, the "$?" was returning the exit code of whatever command was run prior, not of the rsh (the "$?"...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 07:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy