background preloader

Unix

Facebook Twitter

La vache libre - Actu GNU/Linux, Logiciels Libres, Geek et autres vacheries inutiles mais indispensables. Explainshell.com - about. The Ultimate Programmer’s Guide to Bash Scripting. The Bash variables are case sensitive, and using their names in uppercase is a convention.

The Ultimate Programmer’s Guide to Bash Scripting

But you’re free to use a lowercase name or mix cases. The name of a variable can contain only letters (a-z or A-Z); numbers (0-9); or the underscore character ( _), starting with a letter. Don’t start them with a digit and no spaces before and after the = symbol. Please note that some websites recommend using all-lowercase variable names since system-variable names are usually all in uppercase. Pin on Raspberry Pi. How can I sort numbers in a unix shell? How to sort an array in Bash. Scripts - Display a sorted array. Bash - Mathematical operations on arrays from logged lines. Array Basics in Shell Scripting. Consider a Situation if we want to store 1000 numbers and perform operations on them.

Array Basics in Shell Scripting

If we use simple variable concept then we have to create 1000 variables and the perform operations on them. But it is difficult to handle a large number of variables. So it is good to store the same type of values in the array and then access via index number. Array in Shell Scripting An array is a systematic arrangement of the same type of data. But in Shell script Array is a variable which contains multiple values may be of same type or different type since by default in shell script everything is treated as a string.

How to Declare Array in Shell Scripting? 1. ARRAYNAME[INDEXNR]=value 2. Declare -a ARRAYNAME 3. ARRAYNAME=(value1 value2 .... valueN) or [indexnumber=]string To Print Array Value in Shell Script? To Print All elements [@] & [*] means All elements of Array. echo ${ARRAYNAME[*]} Output: To Print first element prakhar prakhar To Print Selected index element echo ${ARRAYNAME[INDEXNR]} rishabh ankit. Programmation Bash/Calculs. Un livre de Wikilivres.

Programmation Bash/Calculs

Trois méthodes permettent d'effectuer des calculs, la première utilise la syntaxe spéciale $((operation)), la seconde utilise la commande let. How to sort an array in Bash. How To: Disable Sleep on Ubuntu Server. Ubuntu 19.10 You may remember that I have a small automation server in my home office that’s running Ubiquiti UniFi Controller software and where I upgraded UniFi Controller on Ubuntu 19.04.

How To: Disable Sleep on Ubuntu Server

I noticed that this server hasn’t been terribly available since upgrade to Ubuntu 19.04: more than once I went looking for the server and it was offline. Now that I’m finally progressing with centralized RSyslog setup at home, I noticed that the UniFi controller server was reporting the following in logs recently: Feb 25 22:15:38 server NetworkManager[737]: <info> [1582668938.0193] manager: sleep: sleep requested (sleeping: no enabled: yes) Feb 25 22:15:38 server NetworkManager[737]: <info> [1582668938.0239] manager: NetworkManager state is now ASLEEP Feb 25 22:15:38 server whoopsie[1025]: [22:15:38] offline Feb 25 22:15:38 server gnome-shell[956]: Screen lock is locked down, not locking Feb 25 22:15:38 server systemd[1]: Reached target Sleep. 16.10 - Ubuntu Installer doesn't detect Windows 10.

Add network card

Boot - Add Windows 10 to GRUB OS list. CentOS / RHEL : How to find if a network port is open or not? – The Geek Diary. A TCP/IP network connection may be either blocked, dropped, open, or filtered.

CentOS / RHEL : How to find if a network port is open or not? – The Geek Diary

These actions are generally controlled by the IPtables firewall the system uses and is independent of any process or program that may be listening on a network port. Beyond the firewall, a program or process (a server or daemon) may be listening on a port or not listening. CentOS 7 : Utilisation et configuration de firewalld. CentOS : Installer CentOS 8 avec Xfce - Wiki - Wiki. Table des matières Introduction Beaucoup de personnes apprécient Xfce pour sa légèreté, et CentOS pour sa stabilité.

CentOS : Installer CentOS 8 avec Xfce - Wiki - Wiki

CentOS 8 n'offre que GNOME comme environnement de bureau. Dans cet article, nous allons voir comment installer CentOS 8 avec Xfce. Installation de CentOS On va s’équiper du média d’installation de CentOS 8. Veiller à bien activer le réseau à l'installation (Désactivé par défaut) puis effectuez le partitionnement de votre choix. Dans la sélection logicielle, prendre une installation de base de CentOS : Configuration des dépôts Une fois l'installation terminée, si vous n'avez pas fait l'installation réseau, effectuez une mise à jour Copier vers le presse-papierCode BASH : Ensuite, initialisez le dépôt EPEL : Si vous voulez, vous pouvez ajouter au besoin d'autres dépôts : How to Configure CentOS 7 Network Settings - Serverlab. The following tutorial will guide you through configuring CentOS 7 network settings.

How to Configure CentOS 7 Network Settings - Serverlab

If you are familiar with CentOS 6 or lower, you will notice that the network configuration files are largely the same. The biggest difference between the latest major version and those below it is the naming convention for network interfaces. Prior to CentOS 7 the network interfaces were numbered, starting from 0. The first interface would also be named eth0. This is no longer the case, as the first network interface is now labeled enp3s0. Bash - How to echo shell commands as they are executed. Source command. ← Shell functions library • Home • Recursive function → The source command can be used to load any functions file into the current shell script or a command prompt.It read and execute commands from given FILENAME and return.The pathnames in $PATH are used to find the directory containing FILENAME.

Source command

If any ARGUMENTS are supplied, they become the positional parameters when FILENAME is executed. Syntax The syntax is as follows: source filename [arguments] source functions.sh source /path/to/functions.sh arg1 arg2 source functions.sh WWWROOT=/apache.jail PHPROOT=/fastcgi.php_jail Example. How to change input keyboard layout while in console?