Skip to main content
Code Review

Questions tagged [bash]

BASH is the GNU Bourne Again SHell, the successor to the classic Unix Bourne sh (shell). It's the default shell for various GNU systems.

Filter by
Sorted by
Tagged with
6 votes
3 answers
790 views

Linux file encryption using GPG key

In the below script I am using some arrays, and other Bash stuff, but I have made a minimal working example for you, where you cannot see those things. Anyway, I am interested in a review of the ...
8 votes
2 answers
464 views

Disabling local accounts on Azure Linux virtual machines

We’re enforcing Azure Entra authentication across all Linux VMs, so we’ll disable all local accounts via a custom script. The script will also create a single "break-glass" user with a randomly ...
8 votes
5 answers
403 views

Custom hash function as Bash script

I'm looking for a (possibly cryptographic strong) hash function in Bash with the following properties: The input is only a string with 4 lower-case characters: aaaa to zzzz The output should be a ...
8 votes
2 answers
289 views

Simple Node.js version manager

On Arch Linux, there are 2 packages that provide the Rust toolchain: rust itself and rustup. When users try to install a package ...
3 votes
1 answer
225 views

Script to fix filenames in the wrong encoding

If you have files with Cyrillic filenames (e.g. день) and pack them as a ZIP archive on Windows, and then unpack on Mac using the standard archive utility, the ...
jsx97's user avatar
  • 207
7 votes
3 answers
293 views

lndir shell function - hardlink two directories

The code works, but I could use help testing it more comprehensively and double-checking that everything I'm doing makes sense, and that all the options can coexist with each other. I'm running into ...
5 votes
2 answers
133 views

Bash Script for Docker Image Cleanup

I’ve been working on a bash script to clean up old Docker images while keeping the latest tag for each repository and skipping images currently in use. I’m sharing the script below and would ...
Ilgar's user avatar
  • 51
1 vote
2 answers
130 views

Start screen lock for user from systemd

This is a script to start a screen lock in Ubuntu, with user customizable background image(s). The script will eventually be run on sleep by systemd, so by root. This made it complicated to let the ...
Gauthier's user avatar
  • 306
1 vote
1 answer
51 views

Automating Arch Linux Installation with Custom Partitioning and Disk Setup

I'm trying to automate my Arch Linux installation using a bash script. The script would allow me to choose between installing Arch on a single SSD or using a combination of SSD (for root and home) and ...
DarKnightz's user avatar
3 votes
4 answers
147 views

Bash script to automate post install process on Fedora

The script runs fine, and it seems to be working correctly. I'm looking for some criticism of the structure of the code, errors, bad practices, beginner's pitfalls, and bad code in general. I'm ...
8 votes
1 answer
712 views

Ask interactive user to respond yes or no

I've written a Bash function that can ask a simple yes/no question. The "yes/no" prompt is translated to the user's language (the question must be localised by the caller). Input is ...
Toby Speight's user avatar
  • 87.9k
1 vote
0 answers
92 views

Conflict-less Bash library function and variable naming

Marvelous Bash does not support built-in sufficient namespace features for functions or variables to specific file/module you would find in PHP or JavaScript. Conflicts in global scopes, which are ...
5 votes
2 answers
94 views

Clean up and datestamp file names

I would like to ask for a review of the following Bash script which cleans up and datestamps file names, with an optional feature to rename the file. The main use case is renaming files downloaded ...
2 votes
2 answers
67 views

Check if program has been installed successfully at a given path

The path is provided as an argument by a Makefile within an install target. The script verifies if the specified path is already included in the system's ...
Madagascar's user avatar
  • 10.1k

15 30 50 per page
1
2 3 4 5
...
56

AltStyle によって変換されたページ (->オリジナル) /