Skip to main content

Questions tagged [bash]

Questions specific to GNU’s Bourne Again SHell, as opposed to other Bourne/POSIX shells. For questions about Unix shells in general, use the /shell tag instead. For shell scripts with errors/syntax errors, please check them with the shellcheck program (or in the web shellcheck server at https://shellcheck.net) before posting here.

-1 votes
1 answer
62 views

I am trying to execute a script that loops through a set list of interfaces and pings a known destination. It is possible that one of the interfaces may not always be available. Right now, script ...
HanSooloo's user avatar
  • 127
5 votes
1 answer
228 views

I'm running a reasonably up-to-date Msys2: $ uname -a; bash -version MSYS_NT-10.0-26100 md2syz7c 3.6.6-2369286a.x86_64 2026-01-14 12:29 UTC x86_64 Msys GNU bash, version 5.3.9(1)-release (x86_64-pc-...
Peter - Reinstate Monica's user avatar
0 votes
2 answers
169 views

I'm looking at ways to handle secure password input during scripts but where the password is displayed as it is typed (for multiple reasons). I'm currently using read pwd to read in the password, ...
Synthetic Ascension's user avatar
1 vote
1 answer
81 views

How can I simply and easily display all members of a group where the group is primary for the users? Most posts show getent group <groupname>, but that only shows me the group name and the group ...
ReflectYourCharacter's user avatar
3 votes
3 answers
402 views

Currently in Debian I use such a command to save the ping history to a file (with the exact time): ping -c 3600 1.1.1.1 | ts '[%F %T]' | tee -a /home/user/testping.txt How to: Have all ping responses ...
DarekH's user avatar
  • 309
8 votes
2 answers
405 views

I have multiple bash functions that generate temporary files and the naive me started to create RETURN traps within them to clean those files up, just to learn that nesting traps is really tricky... ...
Fravadona's user avatar
  • 1,780
1 vote
2 answers
85 views

I'm writing a bash script that archives logs from a folder where various servers dump their logs. From there, it moves them to one of three OneDrive mounts that are mounted with rclone (which I think ...
user1311554's user avatar
0 votes
2 answers
69 views

I want to execute an Ansible playbook over a couple of servers and see some issues with ssh connectivity on the way (mismatches in my local known_hosts I am guessing). I want to solve this by ...
vrms's user avatar
  • 283
1 vote
4 answers
80 views

I'm trying to write a Bash script to automatically add the configuration of the WordPress WP Offload Media plugin to the wp-config.php file, asking for the Amazon Web Services (AWS) credentials ...
IT With Me's user avatar
0 votes
1 answer
64 views

In KDE System Settings locale is UK apart from keyboard layout, which is Italian. For some reason, this is the output of the locale command: LANG=en_GB.UTF-8 LC_CTYPE="en_GB.UTF-8" ...
Signor Pizza's user avatar
-3 votes
3 answers
95 views

I have a file like this > cat /tmp/lists # user0 db0 # user1 db1 # user2 db2 I want to extract two arrays (column 2, column 3) from this, so I end up with roles=...
vrms's user avatar
  • 283
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
-3 votes
2 answers
179 views

Assume that, for whatever reason, a bash script must go through stdin once and then go through that very same input again. For example, a script might need to know the number of lines that stdin input ...
Melab's user avatar
  • 4,530
1 vote
2 answers
248 views

When you have a function f defined in a Bash script, you can call it using $(f). However, this creates a subshell in which the function is called. Consider this example: #!/usr/bin/bash f() { echo ...
k314159's user avatar
  • 553
-2 votes
2 answers
141 views

I was trying to craft a script that produces the location of the local bash binary from a variety of (Linux) environments, assuming existence of standard shell /bin/sh and that /usr/bin/env bash is ...
user22476690's user avatar

15 30 50 per page
1
2 3 4 5
1820