Sponsored Content
Top Forums Shell Programming and Scripting Q: Is SQRT(n) possible in a POSIX compliant shell? A: Yes within limits. Post 303039674 by wisecracker on Friday 11th of October 2019 12:45:21 PM
Old 10-11-2019
Quote:
Originally Posted by jim mcnamara
Paul Hsieh's square root page has a bunch of square root algorithms including using Newton's method:

Paul Hsieh's Square Root page

I used to play with these, lots o' fun.
Neat, not an integer shell version though. It would be interesting if someone else has actually done it...
Working on Nth root at the moment, but I suspect it will be a step too far for a POSIX shell.

@Neo...

The dark green looks good...

Moderator's Comments:
Mod Comment Discussion on new forum tag and color changes moved here.
 

10 More Discussions You Might Find Interesting

1. Programming

sqrt

Hi! when i'm trying to compile this lite example on my linux machine I'll get errors and i don't know why.. #include <stdio.h> #include <math.h> /* needed by sqrt() */ int main() { printf("%f", sqrt(10.0)); return (0); } this is the error: /tmp/cc33hNVHK.o: In function... (1 Reply)
Discussion started by: CreamHarry
1 Replies

2. Programming

Is gcc compliant with the C++ standards

Hello Friends, I am a newbie and have started using different compilers and tools to make myself familiar with their workings. I wanted to know that how compliant is gcc with the C++ standards. It is pretty obvious that no compiler is close to being completely compliant, but if there are some... (7 Replies)
Discussion started by: hthapar
7 Replies

3. UNIX for Dummies Questions & Answers

sqrt in bash

Hi, i have a the following script: #!/bin/bash a=3 b=9 let "c= b*a" let "d=sqrt $c " echo $d But when i execute the code, it gives me the an error saying: line 5: let: d=sqrt 27 : syntax error in expression (error token is "27 ") Can any body tell me what I'm doing wrong? (5 Replies)
Discussion started by: limadario
5 Replies

4. Shell Programming and Scripting

Logical expression in POSIX compliant Korn Shell

Hi, i want to check if a variable var1 is not a or b or c pseudo code: If NOT (var1 = a or var1 = b or var1 = c) then ... fi I want to use POSIX complaint Korn shell, and for string comparison For the following code, logical.sh #!/usr/bin/ksh var="j" echo "Var : $var" if ! { || ||... (12 Replies)
Discussion started by: ysrini
12 Replies

5. UNIX for Dummies Questions & Answers

Soft and hard limits for nproc value in /etc/security/limits.conf file (Linux )

OS version : RHEL 6.5 Below is an excerpt from /etc/security/limits.conf file for OS User named appusr in our server appusr soft nproc 2047 appusr hard nproc 16384 What will happen if appusr has already spawned 2047 processes and wants to spawn 2048th process ? I just want to know... (3 Replies)
Discussion started by: kraljic
3 Replies

6. Shell Programming and Scripting

Is Rule 7 of POSIX shell grammar rules written correctly?

The POSIX shell standard grammar rules are at Shell Command Language I am trying to understand Rule 7 and I don't. I think there may be some mistakes there. I am not complaining about the standard; rather, I am concerned that my perception is wrong, and I don't understand something important.... (3 Replies)
Discussion started by: Mark_Galeck
3 Replies

7. Shell Programming and Scripting

Pure POSIX shell scripting...

Hi all... This is more of a concensus question than help... As many of you know I am experimenting with the limitations of Pure POSIX shell scripting. Q: Is the directory /bin considered part of the Pure POSIX shell or must I stick entirely with the builtins only? The reason is I... (2 Replies)
Discussion started by: wisecracker
2 Replies

8. What is on Your Mind?

Popularity-Boost for the POSIX-Shell in the Era of Containerized Computing?

Not even thinking that POSIX-Shell is deprecated, but I like working with bash very much, because of it's increased comfort and advanced functions. And in my world here it's available everywhere as default. Working with kubernetes now, it seems there is a paradigm shift in terms of resources.... (1 Reply)
Discussion started by: stomp
1 Replies

9. Shell Programming and Scripting

Equivalent to let command in POSIX shell

Hi all, I am learning POSIX shell programming, and the book I read, uses the let command for integer arithmetic. I have downloaded and use the shellcheck program on Linux. This programs says: In POSIX sh, 'let' is undefined. See the screenshot attached. What is the POSIX... (1 Reply)
Discussion started by: johnprogrammer
1 Replies

10. OS X (Apple)

Generate a random number in a fully POSIX compliant shell, 'dash'...

Hi all... Apologies for any typos, etc... This took a while but it didn't beat me... Although there are many methods of generating random numbers in a POSIX shell this uses integer maths and a simple C source to create an executable to get epoch to microseconds accuracy if it is needed. I take... (8 Replies)
Discussion started by: wisecracker
8 Replies
bsetroot(1)						      General Commands Manual						       bsetroot(1)

NAME
bsetroot - blackbox utility to change root window appearance SYNOPSIS
bsetroot -help bsetroot [ -display display ] -solid color bsetroot [ -display display ] -mod x y -fg color -bg color bsetroot [ -display display ] -gradient texture -from color -to color DESCRIPTION
Bsetroot is a utility that can control the appearance of the root window in three ways: Either give it a solid color, or write a two color modula pattern to it, or render a gradient texture, based on two different colors. Bsetroot resembles xsetroot(1) in this functionality but it supports multiple screen displays, and gradient textures the same way as Black- box does. It doesn't handle cursors etc. Bsetroot is part of the Blackbox package. OPTIONS
Bsetroot operates in three ways, you must choose one of the first 3 options: -solid color Sets the root window to specified color. -mod x y Creates a modula pattern. You must specify -bg and -fg colors. -gradient texturestring Renders the specified texture string to the root window. For possible texture strings, please refer to blackbox(1). You must also specify both a -from and a -to color. -display display Tells Bsetroot to connect to the specified display. -bg, -background color Background color. Needed for -mod patterns. -fg, -foreground color Foreground color. Needed for -mod patterns. -from color Start color for rendering textures. Needed for -gradient operation mode. -to color Ending color for rendering textures. Needed for -gradient operation mode. -help Prints version info and short help text. AUTHOR
Bsetroot was written and maintained by Brad Hughes (blackbox@alug.org) and Jeff Raven (jraven@psu.edu). SEE ALSO
blackbox(1) 0.60.3 June 16th, 2000 bsetroot(1)
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy