Skip to main content

Questions tagged [shell]

The term 'shell' refers to a general class of text-based command interpreters most often associated with the Unix & Linux operating systems.

3 votes
2 answers
572 views

Final look at my Lightshot print screen Linux handler POSIX shell script

I would like to ask for a final review of my Lightshot print screen Linux handler POSIX shell script. When I started writing it, it was a one-liner (shell snippet), but then I decided to grow it, and ...
Vlastimil Burián's user avatar
8 votes
2 answers
476 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 ...
Dev's user avatar
  • 81
8 votes
2 answers
300 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 ...
404 Name Not Found's user avatar
12 votes
3 answers
1k views

Simplified simulation of Unix "ls" command made using C++ std::filesystem library

I have just implemented this while getting acquainted with the std::filesystem library. On input from console, the program accepts two arguments: ...
Giogre's user avatar
  • 515
7 votes
3 answers
307 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 ...
Sinjai's user avatar
  • 317
1 vote
2 answers
140 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
4 votes
1 answer
77 views

Simulating mv --backup=numbered with BSD mv

...
user avatar
2 votes
2 answers
115 views

Using git autobackup with shell script

I have php website for prevent hacker modify any file and inject backdoor. I want to use git as a file tracking solution. This is my shell script: ...
Anas's user avatar
  • 129
1 vote
1 answer
99 views

Rust code to print shell prompt

I'm new to Rust, and this is my first successful significant Rust code. It prints a prompt(which is technically a string) to the console. I'm struggling with concepts like ...
candifloss__'s user avatar
2 votes
0 answers
75 views

Replace real path with symlink

zoxide is a replacement for cd that allows fuzzy matching against commonly accessed directories (e.g., ...
404 Name Not Found's user avatar
3 votes
4 answers
163 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 ...
Kizouyummi's user avatar
1 vote
0 answers
106 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 ...
Serious Angel's user avatar
2 votes
2 answers
81 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
2 votes
1 answer
166 views

Update a docker compose service properly

I'm currently running an executable in Docker that has been mounted as a Docker volume in the foreground. The executable (or the service) continuously generates console output and can be interrupted ...
Tobias Grothe's user avatar
5 votes
2 answers
142 views

A shell function to copy files and directories, preserving directory structure

For a script, I came up with a shell function that might be generally useful. Before I add it to the code base, I’d like to hear someone’s opinion on this. I don’t write shell scripts often and had to ...
Bolpat's user avatar
  • 243

15 30 50 per page
1
2 3 4 5
22