Lateo.net - Flux RSS en pagaille (pour en ajouter : @ moi)

🔒
❌ À propos de FreshRSS
Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
☐ ☆ ✇ nixCraft

A Bash Script to Read All Command Line Arguments into an Array: Simplify Argument Handling

Par : Vivek Gite — 7 mai 2024 à 12:40

If you are writing a Bash shell script, you should read command-line arguments into an array for some time. This allows us to process any number of arguments provided when the script is run. This makes the script adaptable to different use cases. Instead of dealing with fixed variables like $1, $2, $3, etc., you can work with any number of arguments more dynamically using bash for loop or bash while loop, depending upon your needs. Arrays make it simple to loop through each argument and perform operations on them, whether basic printing or complex processing. Bash provides a mapfile (readarray command) internal built-in command to read lines from a file into an array variable. Let us see how to use mapfile to read all command line arguments into an array.

Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit

The post A Bash Script to Read All Command Line Arguments into an Array: Simplify Argument Handling appeared first on nixCraft.

☐ ☆ ✇ nixCraft

How to write the output into the file in Linux

Par : Vivek Gite — 22 août 2020 à 12:01

How do I write the output into the file in Linux bash shell? Can you explain I/O redirection for both bash and POSIX shell to write data to the file under Unix or Linux?

The post How to write the output into the file in Linux appeared first on nixCraft.

☐ ☆ ✇ nixCraft

Curl Shell Script To Purge Cache From Stackpath CDN

Par : Vivek Gite — 4 juillet 2020 à 12:17
A content delivery network or content distribution network (CDN) is a system of servers containing copies of data, placed at various points in a network so as to maximize bandwidth for access to the data from clients throughout the network. Please note that the following script will only work with Stackpath CDN. You need to get API access keys using stackpath portal.
☐ ☆ ✇ nixCraft

How to extract tar.xz files in Linux and unzip all files

Par : Vivek Gite — 14 mai 2020 à 13:18


How do I extract tar.xz files in Linux? Can you tell me command to unzip linux-5.6.13.tar.xz file? How can I uncompressing (or decompressing) all files in the current directory?

The post How to extract tar.xz files in Linux and unzip all files appeared first on nixCraft.

☐ ☆ ✇ nixCraft

Linux shell script to reduce PDF file size

Par : Vivek Gite — 27 novembre 2019 à 17:48
Here is a handy and useful Linux and Unix shell script that reduce PDF file size using Ghostscript. No need to upload your PDF file to the shady third-party website. Just do it from the terminal. I tested it with both CentOS and Ubuntu/Debian Linux.
☐ ☆ ✇ nixCraft

Bash shell find out if a variable has NULL value OR not

Par : Vivek Gite — 27 décembre 2018 à 10:12

I am a new to shell scripting. How do I check for NULL value in a Linux or Unix shell scripts?

The post Bash shell find out if a variable has NULL value OR not appeared first on nixCraft.

❌