Trying to find meaning of command with ½
I do not recognize what the command line with ???? means.
Can someone explain it to me. Code:
OUT=`curl -m 2 --range 0-0 $URL 2> /dev/null|while read -n 1 C |
This is an odd character and is not a command either the file is corrupt or you are using the wrong encoding try using 'cat' on the file as it usually gets the encoding right.
|
The way I read that code fragment is that the variable OUT gets 0xC20xBD appended if there is a file available at $URL.
Are we trying to hack our Nikes? Apparently those two bytes are used to specify a device address for a nRF24L01 ultra low power RF transceiver. http://dmitry.gr/index.php?r=05.Proj...%20plus%20iPod http://stackoverflow.com/questions/2...an-i-access-it |
This is from a curl file splitting script:
http://splitcurl.googlecode.com/git/splitcurl Those 2 characters appear there and when viewed with cat/vi. This part of the script is testing for "splitness" which may be how evenly they are split?? Since the output is dumped to null and times out after 2 seconds and is examining the 1st byte, appending those characters to whatever is in COPY would guarantee the length ${#OUT} is greater than 1, regardless, wouldn't it? Such logic if I have followed it correctly seems superfluous. Please correct me if I have done an injustice to the coder. |
Quote:
Code:
if [ X${SOMESTRING} = "X" ];then So the coder MAY have just tacked this character on to the end of the string in which case the string would be greater than one if curl had downloaded something and have a length of 1 if not, personally I would do a check for an empty/null string but that's just personal preference. Try replacing the odd character with say 'X' and run the script if it behaves as it should then that is the reason for the odd character. |
Don't feel sorry Keith, initially I saw that as a string manipulation- dah!
I will be attempting to take UR advise. |
All times are GMT -5. The time now is 10:37 PM. |