Sponsored Content
Full Discussion: Strings to integers?
Top Forums UNIX for Dummies Questions & Answers Strings to integers? Post 302880703 by jhsinger on Sunday 22nd of December 2013 04:52:10 PM
Old 12-22-2013
Correct. I'm concerned only with the file names.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

integers in the if statement

hi, im trying to compare two variables in csh to put in an if statement, eg: set a = $firstnum set b = $secondnum if ($a -ge $b) echo $a But I get an error ("if: Expression syntax"). How can I make csh see my variables as integers? thanks in advance! (5 Replies)
Discussion started by: Deanne
5 Replies

2. Programming

Using write() with integers in C

I'm trying to write an integer to a file using the write() function, but write() requires the parameter to be written to be a const void*. How would I go about doing this? also: using itoa() produces a " warning: implicit declaration of function 'itoa' " even though i have #included stdlib.h (2 Replies)
Discussion started by: h@run
2 Replies

3. Shell Programming and Scripting

Add non-integers using ksh

I would like to add 4.7 and 1.2. However I am unable to do this with expr. Any simple ideas (even using something other than expr)? Example: me> expr 4 + 1 5 me> expr 4.7 + 1.2 expr: 0402-046 A specified operator requires numeric parameters. (18 Replies)
Discussion started by: 2dumb
18 Replies

4. Shell Programming and Scripting

Strings to integers in an arithmetic loop

Hi all, Could someone please advise what is the correct syntax for my little script to process a table of values? The table is as follows: 0.002432 20.827656 0.006432 23.120364 0.010432 25.914184 0.014432 20.442655 0.018432 20.015243 0.022432 21.579517 0.026432 18.886874... (9 Replies)
Discussion started by: euval
9 Replies

5. Shell Programming and Scripting

Cancel down 2 integers

Wonderful evening to all of you! My problem has to possible starting points. Well, not really, but getting to either one is no problem at all. So i got either a string in the format of "1920x1080" or simply the integers X = 1920 and Y = 1080. When I am done, I would like to have an output... (5 Replies)
Discussion started by: jakunar
5 Replies

6. Shell Programming and Scripting

Comparison treating strings as zero integers

I'm trying to write a bash script to perform basic arithmetic operations but I want to run a comparison on the arguments first to check that they're a number greater than zero. I want an error to pop up if the arguments args aren't >= 0 so I have: if ! ]; then echo "bad number: $1" fi ... (14 Replies)
Discussion started by: TierAngst
14 Replies

7. Shell Programming and Scripting

Grep float/integers but skip some integers

Hi, I am working in bash in Mac OSX, I have following 'input.txt' file: <INFO> HypoTestTool: >>> Done running HypoTestInverter on the workspace combined <INFO> HypoTestTool: The computed upper limit is: 11 +/- 1.02651 <INFO> HypoTestTool: expected limit (median) 11 <INFO> HypoTestTool: ... (13 Replies)
Discussion started by: Asif Siddique
13 Replies

8. Shell Programming and Scripting

awk -- telling the difference between strings and integers

This should be a really easy question. My input file will have a few fields that are strings in the first line, which I will extract and save as variables. The rest of the fields on every line will be integers and floating point numbers. Can awk tell the difference somehow? That is, is there... (5 Replies)
Discussion started by: Parrakarry
5 Replies

9. Shell Programming and Scripting

Bash Integers/String

Hy friends, I am newbie to bash scripting, can anyone explain how b=${a/23/BB} # Substitute "BB" for "23". this line converts "b" into string and and "d" into Integer. Thanks in advance (4 Replies)
Discussion started by: Qazi
4 Replies

10. Shell Programming and Scripting

Comparing Integers (I think)

Hi, I can't figure out what I'm missing. I'm running a query to see if there are any streams recording on my DVR before starting a scripted update. I'm guessing that it is viewing $VIDEO as a string instead of an int. I've tried everything I saw on google but it still comes back as $VIDEO is... (8 Replies)
Discussion started by: Rhysers
8 Replies
SENDIP(1)								FSF								 SENDIP(1)

NAME
sendip - Send arbitrary IP packets SYNOPSIS
sendip [-v] [-d data] [-h] [-f datafile] [-p module] [module options] hostname OPTIONS
-d data add this data as a string to the end of the packet Data can be: rN to generate N random(ish) data bytes; 0x or 0X followed by hex digits; 0 followed by octal digits; any other stream of bytes -f datafile read packet data from file -h print this message -p module load the specified module (see below) -v be verbose Modules are loaded in the order the -p option appears. The headers from each module are put immediately inside the headers from the pre- vios model in the final packet. For example, to embed bgp inside tcp inside ipv4, do sendip -p ipv4 -p tcp -p bgp .... Modules available at compile time: ipv4 ipv6 icmp tcp udp bgp rip ntp Arguments for module ./bgp.so: -bm x BGP Marker field (format is <hex byte>:<hex byte>:...) Default: FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF -bl x Packet length Default: Correct -bt x Message Type (1 OPEN, 2 UPDATE, 3 NOTIFICATION, 4 KEEPALIVE Default: 4 (KEEPALIVE) -bo x Open message. Format is <version>:<AS number>:<Hold time>:<BGP Identifier>:<Options length> Default: 4:1:90:127.0.0.1:Correct (Any parameter can be omitted to get the default) -boo x Optional OPEN parameter. Format is <Type>:<Length>:<Value> - value is in hex bytes separated by :s Default: Length may be omitted to get correct value -bul x Withdrawn routes length Default: Correct -buw x Withdrawn route. Format is x.x.x.x/n:<bytes for prefix> Default: Bytes field may be omitted to use the correct number -bus x Attributes length Default: Correct -bua x Attribute. Format is <flags>:<type>:<length length (1 or 2):<length>:<data> Default: The length fields may be omitted to use the correct value -bun x NLRI Prefix. Format is as for -buw Default: As for -buw -bn x Notification. Format is <code>:<subcode>:<data> Default: Data may be omitted for no data Arguments for module ./icmp.so: -ct x ICMP message type Default: ICMP_ECHO (8), or ICMP6_ECHO_REQUEST (128) if embedded in an IPv6 packet -cd x ICMP code Default: 0 -cc x ICMP checksum Default: Correct Arguments for module ./ipv4.so: -is x Source IP address (see README) Default: 127.0.0.1 -id x Destination IP address Default: Correct -ih x IP header length (see README) Default: Correct -iv x IP version (you almost definately don't want to change this) Default: 4 -iy x IP type of service Default: 0 -il x Total IP packet length (see README) Default: Correct -ii x IP packet ID (see README) Default: Random -ifr x IP reservced flag (see README) Default: 0 (options are 0,1,r) -ifd x IP don't fragment flag (see README) Default: 0 (options are 0,1,r) -ifm x IP more fragments flag (see README) Default: 0 (options are 0,1,r) -if x IP fragment offset Default: 0 -it x IP time to live Default: 255 -ip x IP protcol Default: 0, or set by underlying protocol -ic x IP checksum (see README) Default: Correct -ionum x IP option as string of hex bytes (length is always correct) Default: (no options) -ioeol IP option: end of list -ionop IP option: no-op -iorr x IP option: record route. Format: pointer:addr1:addr2:... -iots x IP option: timestamp. Format: pointer:overflow:flag:(ip1:)ts1:(ip2:)ts2:... -iolsr x IP option: loose source route. Format: pointer:addr1:addr2:... -iosid x IP option: stream identifier -iossr x IP option: strict source route. Format: pointer:addr1:addr2:... Arguments for module ./ipv6.so: -6f x IPv6 flow ID Default: 32 -6t x IPv6 traffic class Default: 0 -6l x IPv6 payload length Default: Correct -6n x IPv6 next header Default: IPPROTO_NONE -6h x IPv6 hop limit Default: 32 -6v x IP version (you probably don't want to change this -6p x IPv6 priority Default: 0 -6s x IPv6 source address Default: ::1 -6d x IPv6 destination address Default: Correct Arguments for module ./rip.so: -rv x RIP version Default: 2 -rc x RIP command (1=request, 2=response, 3=traceon (obsolete), 4=traceoff (obsolete), 5=poll (undocumented), 6=poll entry (undocumented) Default: 1 -re x Add a RIP entry. Format is: Address family:route tag:address:subnet mask:next hop:metric Default: 2:0:0.0.0.0:255.255.255.0:0.0.0.0:16, any option my be left out to use the default -ra x RIP authenticat packet, argument is the password; do not use any other RIP options on this RIP header -rd RIP default request - get router's entire routing table; do not use any other RIP options on this RIP header Arguments for module ./ripng.so: -Rv x RIPng version Default: 1 -Rc x RIPng command (1=request, 2=response) Default: 1 -Rr x RIPng reserved field (should be 0) Default: 0 -Re x Add a RIPng entry. Format is: Address/route tag/address/len/metric Default: ::/0/128/1, any option my be left out to use the default -Rd RIPng default request - get router's entire routing table; do not use any other RIPng options on this RIPng header Arguments for module ./tcp.so: -ts x TCP source port Default: 0 -td x TCP destination port Default: 0 -tn x TCP sequence number Default: Random -ta x TCP ack number Default: 0 -tt x TCP data offset Default: Correct -tr x TCP header reserved field EXCLUDING ECN and CWR bits Default: 0 -tfe x TCP ECN bit (rfc2481) Default: 0 (options are 0,1,r) -tfc x TCP CWR bit (rfc2481) Default: 0 (options are 0,1,r) -tfu x TCP URG bit Default: 0, or 1 if -tu specified (options are 0,1,r) -tfa x TCP ACK bit Default: 0, or 1 if -ta specified (options are 0,1,r) -tfp x TCP PSH bit Default: 0 (options are 0,1,r) -tfr x TCP RST bit Default: 0 (options are 0,1,r) -tfs x TCP SYN bit Default: 1 (options are 0,1,r) -tff x TCP FIN bit Default: 0 (options are 0,1,r) -tw x TCP window size Default: 65535 -tc x TCP checksum Default: Correct -tu x TCP urgent pointer Default: 0 -tonum x TCP option as string of hex bytes (length is always correct) Default: (no options) -toeol TCP option: end of list -tonop TCP option: no op -tomss x TCP option: maximum segment size -towscale x TCP option: window scale (rfc1323) -tosackok TCP option: allow selective ack (rfc2018) -tosack x TCP option: selective ack (rfc2018), format is l_edge1:r_edge1,l_edge2:r_edge2... -tots x TCP option: timestamp (rfc1323), format is tsval:tsecr Arguments for module ./udp.so: -us x UDP source port Default: 0 -ud x UDP destination port Default: 0 -ul x UDP packet legnth Default: Correct -uc x UDP checksum Default: Correct sendip 2.5 June 2012 SENDIP(1)
All times are GMT -4. The time now is 01:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy