Sponsored Content
Full Discussion: Comparing Integers (I think)
Top Forums Shell Programming and Scripting Comparing Integers (I think) Post 303025553 by vgersh99 on Monday 5th of November 2018 11:10:31 AM
Old 11-05-2018
Also, it might be more efficient NOT to store >800 lines of curl output in a variable to be echo-ed|grep-ed and wc-ed later.
I'd do it in one piped statement and store the count in a variable to be compared later.
My $.02
 

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

bash problem when comparing integers

Hi, When I compare currentfiledate to reportfiledate I get a "-bash: currentfiledate=20090220080101 reportfiledate=20090219231245 if ; then echo -ne "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n" echo -ne "!! Running the load utility !! \n" fi Our... (15 Replies)
Discussion started by: rbournival
15 Replies

4. 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

5. Shell Programming and Scripting

integers, floats and text

I am using gawk in a dos shell in windows xp and want to read a datafile and reformat it. The datafile consists of columns of integers, floating point numbers and text strings. Each column is a fixed width and each column contains the same data type, eg all integers, all text. I am looking for a... (0 Replies)
Discussion started by: lookingfor help
0 Replies

6. 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

7. 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

8. 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

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. UNIX for Dummies Questions & Answers

Strings to integers?

Hi, I'm totally new at this, so help will be appreciated. I have a directory with a bunch of files in it. The files are named xinteger_yinteger_zinteger.vtk (eg, x3_y0_z-1.vtk). I want to read the filenames and then assign the integers to variables that I then can use in expressions. So, for... (6 Replies)
Discussion started by: jhsinger
6 Replies
WCSXFRM(3)						   BSD Library Functions Manual 						WCSXFRM(3)

NAME
wcsxfrm -- transform a wide string under locale LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <wchar.h> size_t wcsxfrm(wchar_t * restrict dst, const wchar_t * restrict src, size_t n); DESCRIPTION
The wcsxfrm() function transforms a null-terminated wide character string pointed to by src according to the current locale collation order then copies the transformed string into dst. No more than n wide characters are copied into dst, including the terminating null character added. If n is set to 0 (it helps to determine an actual size needed for transformation), dst is permitted to be a NULL pointer. Comparing two strings using wcscmp() after wcsxfrm() is equivalent to comparing two original strings with wcscoll(). RETURN VALUES
Upon successful completion, wcsxfrm() returns the length of the transformed string not including the terminating null character. If this value is n or more, the contents of dst are indeterminate. SEE ALSO
setlocale(3), strxfrm(3), wcscmp(3), wcscoll(3) STANDARDS
The wcsxfrm() function conforms to ISO/IEC 9899:1999 (``ISO C99''). BUGS
The current implementation of wcsxfrm() only works in single-byte LC_CTYPE locales, and falls back to using wcsncpy() in locales with extended character sets. Comparing two strings using wcscmp() after wcsxfrm() is not always equivalent to comparison with wcscoll(); wcsxfrm() only stores information about primary collation weights into dst, whereas wcscoll() compares characters using both primary and secondary weights. BSD
October 4, 2002 BSD
All times are GMT -4. The time now is 08:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy