Sponsored Content
Full Discussion: Coronavirus maths anyone?
The Lounge What is on Your Mind? Coronavirus maths anyone? Post 303045519 by Swathe on Sunday 29th of March 2020 05:25:17 PM
Old 03-29-2020
That was pretty interesting
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with Maths

Heres a script i wrote as a bit of practise. What it does is insert a line in the middle of a file. The line being $1 and the file being $2 #!/bin/bash rm tempfile touch tempfile count=1 linenum= `wc -l < $2` if then echo $1 >> $2 else even=`expr "$linenum" % 2` if then... (3 Replies)
Discussion started by: Quesa
3 Replies

2. Shell Programming and Scripting

Perl - maths equation - need help

if input to the perl program is ' ( p * ((a+b) * (c+d))) + q ' it shuld give the output as ' pac + pad + pbc + pbd + q ' .can anyone suggest a way to do this ? (7 Replies)
Discussion started by: Anuj8584
7 Replies

3. Shell Programming and Scripting

Maths with variables

Hello, I'm trying to write a while loop for a decimal value in tcsh which I know can't be done. Instead I want my increments to be one order of magnitude too large and then divide it by 10 when I use the variable. However, I don't know how to divide my variable and set it as another. set... (1 Reply)
Discussion started by: DFr0st
1 Replies

4. Shell Programming and Scripting

Using IF statements with maths where the input is not an integer

Hi All I've made a few scripts which using GDAL extract the value of a pixel within a given raster. The purpose is to work out the combine value of every pixel. I thought there may have been an easier way to do this but alas! The code below extracts the pixel value at position X Y. The... (3 Replies)
Discussion started by: StudentFitz
3 Replies

5. Shell Programming and Scripting

Simple maths calculator loop.

Hi, I am trying to make a maths calculator that: 1. Prompts the user for a number. 2. Prompts the user for an operation (add, subtract, divide or multiply) 3. Prompts the user for a number. 4. Prompts the user for another operation (same as above) OR the option to get the result for the... (4 Replies)
Discussion started by: johnthebaptist
4 Replies

6. Shell Programming and Scripting

Maths in shell scripts

Hi, Need help on this. I need to increment a variable by 1 but retain as 2 characters. I am using expr to do additions: NEWSERIAL=`expr $SERIAL + 1` $SERIAL can range from 01-99. After adding "1", I need the result to be 2 characters, eg: 02+1 = 03. By default expr will truncate the... (4 Replies)
Discussion started by: vchee
4 Replies

7. Shell Programming and Scripting

Calculate the constant e to 14+ decimal places using integer maths.

Hi guys... I am loving this integer maths thing. 64 bit systems are certainly easier than 32 bit, but hey, I don't intend to leave out my fav' platform. Using one of the 'Brothers' methods, URL inside the code. #!/bin/sh # # #!/usr/local/bin/dash # e_constant.sh # Brother's formula . #... (2 Replies)
Discussion started by: wisecracker
2 Replies

8. Programming

Wuhan Coronavirus Status for China - Rapid Prototype Blynk App with ESP8266

Here is a rapid prototype app I just put together which might be of interest to some people. Basically, I have parsed the data from a Chinese web site which is tracking the Wuhan coronavirus, and cache that data every minute via a local cron file and make a simple API available to a Blink app. ... (6 Replies)
Discussion started by: Neo
6 Replies

9. Programming

Wuhan Coronavirus Status App for China - Rapid Prototype using MQTT and the IoT OnOff IOS App

With a little bit of work, was able to build a nice "Wuhan Coronavirus Status" app using MQTT and the IoT-OnOff app. More on this technique here: ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages The result turned out nice, I think. I like the look and... (10 Replies)
Discussion started by: Neo
10 Replies
HOSTNAMECTL(1)							    hostnamectl 						    HOSTNAMECTL(1)

NAME
hostnamectl - Control the system hostname SYNOPSIS
hostnamectl [OPTIONS...] {COMMAND} DESCRIPTION
hostnamectl may be used to query and change the system hostname and related settings. This tool distinguishes three different hostnames: the high-level "pretty" hostname which might include all kinds of special characters (e.g. "Lennart's Laptop"), the static hostname which is used to initialize the kernel hostname at boot (e.g. "lennarts-laptop"), and the transient hostname which might be assigned temporarily due to network configuration and might revert back to the static hostname if network connectivity is lost and is only temporarily written to the kernel hostname (e.g. "dhcp-47-11"). Note that the pretty hostname has little restrictions on the characters used, while the static and transient hostnames are limited to the usually accepted characters of Internet domain names. The static hostname is stored in /etc/hostname, see hostname(5) for more information. The pretty hostname, chassis type, and icon name are stored in /etc/machine-info, see machine-id(5). OPTIONS
The following options are understood: -h, --help Prints a short help text and exits. --version Prints a short version string and exits. --no-ask-password Do not query the user for authentication for privileged operations. -P, --privileged Acquire privileges via PolicyKit before executing the operation. -H, --host Execute the operation remotely. Specify a hostname, or username and hostname separated by "@", to connect to. This will use SSH to talk to a remote system. --static, --transient, --pretty If status is used (or no explicit command is given) and one of those fields is given, hostnamectl will print out just this selected hostname. If used with set-hostname, only the selected hostname(s) will be updated. When more than one of those options is used, all the specified hostnames will be updated. The following commands are understood: status Show current system hostname and related information. set-hostname [NAME] Set the system hostname. By default, this will alter the pretty, the static, and the transient hostname alike; however, if one or more of --static, --transient, --pretty are used, only the selected hostnames are changed. If the pretty hostname is being set, and static or transient are being set as well, the specified hostname will be simplified in regards to the character set used before the latter are updated. This is done by replacing spaces with "-" and removing special characters. This ensures that the pretty and the static hostname are always closely related while still following the validity rules of the specific name. This simplification of the hostname string is not done if only the transient and/or static host names are set, and the pretty host name is left untouched. Pass the empty string "" as the hostname to reset the selected hostnames to their default (usually "localhost"). set-icon-name [NAME] Set the system icon name. The icon name is used by some graphical applications to visualize this host. The icon name should follow the Icon Naming Specification[1]. Pass an empty string to this operation to reset the icon name to the default value, which is determined from chassis type (see below) and possibly other parameters. set-chassis [TYPE] Set the chassis type. The chassis type is used by some graphical applications to visualize the host or alter user interaction. Currently, the following chassis types are defined: "desktop", "laptop", "server", "tablet", "handset", as well as the special chassis types "vm" and "container" for virtualized systems that lack an immediate physical chassis. Pass an empty string to this operation to reset the chassis type to the default value which is determined from the firmware and possibly other parameters. EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise. SEE ALSO
systemd(1), hostname(1), hostname(5), machine-info(5), systemctl(1), systemd-hostnamed.service(8) NOTES
1. Icon Naming Specification http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html systemd 208 HOSTNAMECTL(1)
All times are GMT -4. The time now is 08:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy