Search Results

Search: Posts Made By: truecall
4,927
Posted By vgersh99
nawk -F, '{n=split($3,a,":");...
nawk -F, '{n=split($3,a,":"); s+=(a[1]*3600+a[2]*60+a[3])}END{printf("%02d:%02d:%02d\n", s/3600,s%3600/60,s%3600%60)}' myFile
4,307
Posted By rdcwayx
Get idea from Scrutinizer's printf %06d 123...
Get idea from Scrutinizer's
printf %06d 123 |sed 's/\(..\)\(..\)\(..\)$/\1:\2:\3/'
4,307
Posted By Scrutinizer
sed 's/^/00000/;s/.*\(..\)\(..\)\(..\)$/\1:\2:\3/'
sed 's/^/00000/;s/.*\(..\)\(..\)\(..\)$/\1:\2:\3/'
4,307
Posted By rdcwayx
$ echo 14322 |awk '{$0=sprintf ("%06d",$0);print...
$ echo 14322 |awk '{$0=sprintf ("%06d",$0);print $1$2,$3$4,$5$6}' FS= OFS=:
01:43:22

$ echo 22 |awk '{$0=sprintf ("%06d",$0);print $1$2,$3$4,$5$6}' FS= OFS=:
00:00:22
4,307
Posted By birei
Hi, Can you use 'perl'? Test this script....
Hi,

Can you use 'perl'? Test this script. The last number is your input parameter (14322 in my example).

$ perl -Minteger -e '$a=$ARGV[0]; while ($a > 100) { push @time, $a % 100; $a /= 100; };...
10,812
Posted By methyl
The "source" command is a "bash" command. Most...
The "source" command is a "bash" command. Most other shells don't support it.
The dot-space-scriptname method works with most Bourne-type shells.
Showing results 1 to 6 of 6

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