Sponsored Content
Top Forums Shell Programming and Scripting Stupid issue with number comparison Post 302324479 by DeCoTwc on Wednesday 10th of June 2009 11:46:46 PM
Old 06-11-2009
Thanks for the try. I tried "-lt" as well and it didn't work. I don't have the output in front of me right now, but it would throw and actual error instead of just triggering the wrong response.

edit:

I get the following when I use -lt (and no quotes around anything)

[~]$ ./bkcheck.orig
99.9219
99.7949
99.8012
99.8723
./bkcheck.orig: line 28: [[: 99.9219: syntax error: invalid arithmetic operator (error token is ".9219")
As of 23:43:48,Brooklyn VOD is streaming at 99.9219%
./bkcheck.orig: line 36: [[: 99.7949: syntax error: invalid arithmetic operator (error token is ".7949")
As of 23:43:49,Queens VOD is streaming at 99.7949%
./bkcheck.orig: line 44: [[: 99.8012: syntax error: invalid arithmetic operator (error token is ".8012")
As of 23:43:49,S.Manhattan VOD is streaming at 99.8012%
./bkcheck.orig: line 52: [[: 99.8723: syntax error: invalid arithmetic operator (error token is ".8723")
As of 23:43:49,N.Manhattan VOD is streaming at 99.8723%

Last edited by DeCoTwc; 06-11-2009 at 12:52 AM..
 

9 More Discussions You Might Find Interesting

1. Programming

random number logic -- issue

I use standard C random number generation logic in my application. long nCounter; long lRndNo; char rand; srand48(nCounter); lRndNo = lrand48(); sprintf(rand,"%010.10d",lRndNo); However we always find that the rand generated starts with '0','1' or '2'. I could not logically prove if... (1 Reply)
Discussion started by: asutoshch
1 Replies

2. UNIX for Advanced & Expert Users

Strange Number comparison issue

Hi, I am comparing two numbers, but it gives strange results: My Code: if then echo "True" else echo "False" fi This code gives False for the follwoing comparison where as True for the following: Any reason for this? Both Should have given False... I am using... (9 Replies)
Discussion started by: shihabvk
9 Replies

3. Shell Programming and Scripting

Issue with String Comparison (if)

Hi, I was trying to do a string comparison using if. However, the comparison result is getting treated as a executable statement. I'm not sure where I'm making the mistake! $ typeset TEST_VAR='YUP' $ if ; then echo 'Got It!'; fi; ksh: : not found. Any help is appreciated! (3 Replies)
Discussion started by: waterdrop
3 Replies

4. Shell Programming and Scripting

comparison of number in linux..

hi all experts, i=1; while do echo $i $i=$i+1 done can I use min=2 max=5 if (($min > $ max)) then else (2 Replies)
Discussion started by: hamnsan
2 Replies

5. Shell Programming and Scripting

Issue with files comparison, help me with a logic

Can someone please help me with a unix logic for below. I tried to get the desired output by using change capture condition in Datastage but its not working properly. i have two files file1, file2 as below. file1 ROW_NO VEND_NO CODE AIR_D OCEAN_D ---------------------------------------- 1 ... (3 Replies)
Discussion started by: JSKOBS
3 Replies

6. Shell Programming and Scripting

Number comparison in ksh on mac with -lt is giving wrong answer

I am trying to run following script in ksh on darwin 11.4.2: freeSpace=2469606195 spaceNeeded=200 ] && echo "no space" || echo "space available" ] && echo "no space" || echo "space available" "-lt" is giving wrong answer as "no space" Whereas '<' works fine. When I change the freespace... (4 Replies)
Discussion started by: sabitha
4 Replies

7. Shell Programming and Scripting

Negative number comparison using nawk on Linux

Hi All, I am trying to compare two negative numbers using awk on linux.But it is giving me wrong result.Same code is working perfectly on solaris. print ((0+new_price) < MIN_PRICE) e.g If I try to compare -1.32(new_price) and -500(min_price) using "<" operator, output is 1 i.e true. ... (5 Replies)
Discussion started by: Rashmee
5 Replies

8. Linux

Linking issue due to so version number

Hi all, currently I'm facing a issue in linking a .so file. In my build machine, I've libcrypto.so.6 and there is a softlink as libcrypto.so. In my make file I'm trying to link to the lib using -L -lcrypto and it is success and created my test.exe. When I copy this test.exe to other... (4 Replies)
Discussion started by: vijkrr
4 Replies

9. Shell Programming and Scripting

awk - 2 files comparison without for loop - multi-line issue

Greetings Experts, I need to handle the views created over monthly retention tables for which every new table in YYYYMMDD format, there is equivalent view created and the older table which might be dropped, the view over it has to be re-created over a dummy table so that it doesn't fail.... (2 Replies)
Discussion started by: chill3chee
2 Replies
mediastreamsegmenter(1) 				    BSD General Commands Manual 				   mediastreamsegmenter(1)

NAME
mediastreamsegmenter -- Create segments from MPEG-2 Transport streams for HTTP Live Streaming. SYNOPSIS
mediastreamsegmenter [-b | -base-url <url>] [-t | -target-duration duration] [-f | -file-base path] [-p | -program [duration]] [-i | -index-file fileName] [-s | -sliding-window-entries entries] [-S | -start-index-file-count entries] [-D | -delete-files] [-v] [-g | -generate-key [period]] [-k | -encrypt-key file] [-K | -encrypt-key-url <url>] [-audio-only] [address:port] DESCRIPTION
The mediastreamsegmenter is a command-line tool that segments media for deployment using HTTP Live Streaming. The mediastreamsegmenter receives an MPEG-2 transport stream over UDP at [address:port] or over stdin and divides it into a series of small media files of approxi- mately equal durations. The mediastreamsegmenter also creates an index file containing references to the individual media files. The index file and media files can then be deployed using common web server infrastructure. The mediastreamsegmenter can produce either live or video-on-demand (VOD) streams. For live streams, the transport stream from the media encoder is ingested, new media files are created and the index file is periodically updated (and older media files expired and deleted). This type of stream is suitable for continuous broadcasts. With VOD streams, small media files representing the entire duration of the presentation are created by the mediastreamsegmenter and an index list containing all segments is generated. This kind of stream allows the client access to the entire program at once. A VOD stream can also be viewed in-progress, giving the user access to an entire event while it is happening. The mediastreamsegmenter can encrypt the segments using AES-128 encryption. To end a session, use the control-C. An end of file tag will be added to the index file. The mediastreamsegmenter command accepts the following arguments: -b | -base-url <url> Specifies a base url to add to the media file name when written into the index file. -t | -target-duration duration Specifies a target duration for the media files. The default duration is 10 seconds. The duration is calculated by looking at the PTS/DTS in the Video transport stream PES. -f | -file-base path Directory to store the media and index files. -p | -program [duration] The program option specifies that a VOD style program is being captured. The [duration] parameter is specified in minutes. To capture an open-ended performance, leave off the [duration] parameter and stop the session by hitting control-C. -i | -index-file fileName This option defines the index file name. The default is prog_index.m3u8. It is recommended that the index file have an extension of .m3u8 or .m3u. -s | -sliding-window-entries entries This option defines the number of media file entries that should be kept in the index file. The default is 5. -S | -start-index-file-count entries This option defines the number of media file entries that must be present before the first index file is written. The default is 3. -D | -delete-files In a live stream, this option will specify that the media files that are no longer in the index file will be removed after an expiry period. -g | -generate-key [period] The -generate-key option will generate an encryption key. If [period] is not specified, it will generate the key 1 time. If [period] is specified, the key will rotate every [period] media files. The -generate-key option requires a -encrypt-key option. -k | -encrypt-key file Specifies an encrypt key file if the -g command is not present. Specifies an encrypt key file if the -g command is present without the period parameter (single encryption file for the entire session). Specifies the directory to store the rotating encryption key if the -g period parameter is specified. -K | -encrypt-key-url <url> HTTP base URL for the encrypt key file to write into the index file. -audio-only Strips the audio elementary stream (AAC/ADTS or MP3) and writes it into the media file. COMPATIBILITY
The mediastreamsegmenter will only work with MPEG-2 Transport Streams as defined in ISO/IEC 14496-1. The transport stream must contain H.264 (MPEG-4, part 10) video and AAC or MPEG audio. If AAC audio is used, it must have ADTS headers. H.264 video access units must use Access Unit Delimiter NALs, and must be in unique PES packets. EXAMPLES
mediastreamsegmenter -b http://foo.com/stream -s 3 -D -f /Library/WebServer/Documents/stream 239.4.1.5:20103 Captures and creates unencrypted Live stream. The index file can be downloaded at http://foo.com/stream/prog_index.m3u8. In steady-state, the index file will contain 3 items. mediastreamsegmenter -b http://bar.com/hiRes -p 120 -f /Library/WebServer/Documents/hiRes -g 15 -k /Volumes/SecureServer/Protected -K https://foo.bar.com/login/key.php?streamname=hiRes 223.1.2.4:12313 Captures and creates an encrypted VOD stream. The encryption key is on a different server, and is accessible via https. Mac OS X April 28, 2009 Mac OS X
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy