Skip to main content

Questions tagged [shell]

The shell is Unix's command-line interface. You can type commands in a shell interactively, or write scripts to automate tasks. Use this tag for questions applying to /bin/sh and most compatible shells (ash, bash, ksh, zsh, …). For shell scripts with errors, please check them in http://shellcheck.net before posting here.

3 votes
1 answer
161 views

According to the Shell Command Language Specification: "2.7.4 Here-Document": Any <backslash> characters in the input shall behave as the <backslash> inside double-quotes (see 2....
becke-ch's user avatar
  • 141
0 votes
2 answers
62 views

While I was trying to write a service that uses a user's environment variables (loaded via .profile), I noticed that systemctl show-environment --user (run as e.g. myuser) would show me a certain set ...
teletype's user avatar
0 votes
2 answers
80 views

I'm writing a shell script that's aimed to be as portable and POSIX-compatible as possible, so usage of bash-only commands or high-level input libraries is undesirable. I'm looking for a way to read a ...
carbon-starlight's user avatar
7 votes
4 answers
805 views

I'm creating a script that runs as root, which needs to run some code (network download and archive unpacking code to be specific) that has some unavoidable attack surface. To lower the damage if this ...
ArrayBolt3's user avatar
0 votes
0 answers
65 views

I have develop a latex render engine that run with kubernetes container pod, now I want to supprot the minted package that need to open the shell escape feature. use std::process::Command; use std::...
Dolphin's user avatar
  • 821
1 vote
1 answer
61 views

It often happens that I have some long task running, like compiling a program, running tests or copying large archives. Once I am done with whatever else I was doing, I want to leave the computer ...
Get rid of LLM slop's user avatar
5 votes
3 answers
1k views

I am using this code to parse the first argument passed to my script. It error handles and it works just the way I want it: if [ -z "$action" ]; then printf "[${c_RED}ERROR${c_RESET}...
EmberNeurosis's user avatar
3 votes
1 answer
145 views

$ wine cmd /c 'echo "hello world"' \"hello world\" Where do the backslashes come from? The command behaves differently in an interactive session: $ wine cmd Microsoft Windows 6.1....
finefoot's user avatar
  • 3,586
4 votes
1 answer
263 views

Suppose we have a script named test_sort in our $PATH with the following contents: #!/bin/bash function echo_text () { printf -- "%s\n" "$fc$oc$fs$lc" printf -- "%s\n&...
Melab's user avatar
  • 4,530
1 vote
2 answers
103 views

Here is a sample directory tree as it would appear if it were sorted in character code order (i.e., directories are not listed first): ${PREFIX}/ .bashrc .include.sh.d/ common.sh ...
Melab's user avatar
  • 4,530
14 votes
2 answers
1k views

I of course realize the need to have something that separates the condition to the actual commands to be executed under the control statement, but why were it chosen to use both semicolon and a ...
skyking's user avatar
  • 498
0 votes
1 answer
121 views

What do I want : On the file manager lf, we can bind some keyboard shortcuts to do either a lf command with :, or a shell command with $, !, or other symbols. According to the documentation, there is ...
ewen-goisot's user avatar
5 votes
2 answers
311 views

In the old times of DOS batch scripts, the only way to check for a variable to be empty or to allow an empty variable was to prepend (or append) a known letter, commonly the letter x, because there ...
Rainer Glaschick's user avatar
0 votes
0 answers
72 views

In a code review on Final look at my Lightshot print screen Linux handler POSIX shell script, specifically in this short answer, it has been pointed out to me, that if there are multiple X servers ...
Vlastimil Burián's user avatar
0 votes
0 answers
47 views

Context I have a system user caddy and a shell script placed under /run/caddy/caddy-cert-obtained-wrapper.sh. /run and /run/caddy are owned by root:root with permissions 0755. caddy-cert-obtained-...
Martin Tovmassian's user avatar

15 30 50 per page
1
2 3 4 5
819