Questions tagged [bash]

Bash is a free shell for Unix-like operating systems from the GNU Project.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Why can the tree view of MC have a folder as root in the version for PowerShell but not the version for Bash?

MC (Midnight Commander) has versions for both Linux Bash and Windows PowerShell. It has tree view but the feature seems different. In order to open a tree view with a folder as root of the tree on the ...
Dan D.'s user avatar
  • 681
-4 votes
1 answer
48 views

Issue Decrypting File with OpenSSL: "hex string is too short, padding with zero bytes to length"

I'm encountering an issue while trying to decrypt a file using Open SSL. I have a file named fc382Crypto.bin provided by my instructor, and I need to decrypt it using the blowfish algorithm with CBC ...
BariBx's user avatar
  • 1
1 vote
0 answers
10 views

Cmder bash failures after DockerDesktop installed

I have been using Cmder on my laptop for development and to execute bash scripts successfully until installing DockerDesktop. DockerDesktop works fine and is using WSL, but now when I run my bash ...
Scott Lindner's user avatar
0 votes
1 answer
24 views

grub-mkconfig doesn't populate /etc/grub.d/10_linux menu entries (Void Linux)

I have been writing a script to install Void Linux (I need something more granular that void-installer). I am able to install grub without issue on UEFI but the BIOS install doesn't work. I do grub-...
SammySP's user avatar
  • 101
0 votes
1 answer
29 views

shell helper function wrapping `find` and ignoring some dirs

I have a bunch of scripts which follow the pattern of: find files which match a pattern do something The problem is that there are several "hazard" directories which are large and slow, ...
Tim Hockin's user avatar
1 vote
1 answer
29 views

git is unable to properly determine the terminal width (git-bash, windows)

As you can see in the screenshot, the terminal is currently 100 characters wide, and both methods of detecting such that I'm aware of are returning the correct value. Despite this, unless I explicitly ...
davidmwhynot's user avatar
0 votes
1 answer
35 views

How to insert argument separating space into brace expansion preamble?

I want to use brace expansion to generate the following argument sequence: ./some_command -c root.foo -c root.bar -c root.baz. Brace expansion at first glance looks as a perfect tool: use -c root. as ...
Ivan Smirnov's user avatar
0 votes
1 answer
46 views

Why does zip --exclude only exclude files in the folder but not the folder itself?

I have the following command run in the bash shell which excludes the files in the folder scripts/. I tried the answer in Zip command for excluding directories and files but unfortunately it did not ...
Macky's Printing Services's user avatar
0 votes
0 answers
18 views

Animating / Modulating parameters in FFmpeg

Say I have a single image, and I want to make a GIF animation out of it. The first frame of the animation should be the image in its original colours, and then the colours should rotate gradually ...
GPWR's user avatar
  • 471
1 vote
1 answer
63 views

Default shell zsh but responding bin/bash

I have no idea what I did! I was installing maven and one of the guides had me do something and now I'm stuck in default zsh. I've tried changing my terminal preferences to be /bin/bash, as well as my ...
beepbeepboop's user avatar
1 vote
0 answers
30 views

WSL run a non-login shell even with `--shell-type login`

Previously running wsl sourced .profile for me, as expected: As of build 16188 when running bash.exe without arguments (or with the ~ argument) bash will be launched as a login shell. The same is ...
Alexey Romanov's user avatar
0 votes
1 answer
30 views

Unable to discard output from redirection followed by &

In the instruction containing a redirection, neither of 1 or 2 or nothing, on the lhs of >/dev/null discards the output, in this case [24] 1073640. This is contrary to my expectation, What could I ...
Erwann's user avatar
  • 141
0 votes
1 answer
47 views

How to extract parts of the international conference video based on spoken language using command line

I have an international conference video which contains two spoken languages, i.e. the video is mixed with sentences of English and Chinese. I would like to remove the Chinese part by command line. ...
John Paul Qiang Chen's user avatar
0 votes
2 answers
95 views

Why is a newly created user account using my personal bashrc?

I set up a home server running Rocky 9 with a minimal install and one user account [mine]. I then created a new user, but when I login as the new user, the bash prompt is using the custom PS1 scheme ...
BlackDiamond's user avatar
0 votes
0 answers
33 views

Run custom shell script through udev

I'm trying to make an udev rule that'll play sound upon connecting the charger. The rule seems to work fine except I can not get the shell script to run. This is my udev rule: $cat 01-mru-battery-...
Abir Halder's user avatar
2 votes
1 answer
68 views

Behavior of SIGINT with Bash

I am running this Bash script: #!/bin/bash for i in $(seq 1 100); do echo $i sleep 1 done When I issue kill -INT <pid> nothing happens -- the script keeps running. If I issue kill -...
rama's user avatar
  • 31
0 votes
1 answer
66 views

What do black (dark grey) files in Debian represent?

I've been racking my brain over this one for awhile now. I have scraped the web and can't find an answer anywhere. What are black (dark grey),font files/file-types in Linux, specifically Debian 12 ...
Druid Monkey's user avatar
0 votes
0 answers
37 views

Bash - autocomplete .bat file

I'm working with MINGW Bash on Windows and run .bat files. My problem is when I type ./<tab><tab> only .sh files are autocompleted. Is there a way to autocomplete all .bat files ?
Chakalaka's user avatar
  • 101
-1 votes
1 answer
45 views

passthru background process sudo multiple commands

Have problem running the command in background. Below is configuration of code. 1] Using php passthru running a command as a different user than current 2] The command has multiple commands to run ...
jd4u's user avatar
  • 99
1 vote
0 answers
47 views

ls in Docker on Windows not showing one directory

I'm running Windows Server 2016 Datacenter version 1607 (build 14393.6614) with Docker Desktop Community Version 2.0.0.3 (31259). I'm running an Ubuntu docker container in an interactive mode with my ...
user1543037's user avatar
1 vote
1 answer
47 views

What does it mean to "run something in a shell profile"

I'm installing Homebrew and I get a message that says: Next steps: ⁃ To add Homebrew to your PATH run brew shellenv in your shell profile (e.g. ~/.bash_profile or ~/.zprofile)" What does it ...
dkv's user avatar
  • 193
1 vote
0 answers
43 views

Issue with Ctrl + Arrow Keys in (Neo)vim using PuTTY

When I establish a SSH connection to my machine using PuTTY, I find that the Control + Arrow keys behave unexpectedly when working with vim or nvim in the bash terminal. For instance, in Vim, escaping ...
N00B_141's user avatar
0 votes
0 answers
62 views

Install a language with ASDF through Ansible on Debian

I'd like to write playbooks to install my development environment. Most steps went well, but I'm struggling to install Ruby through asdf. Playbooks are splitted and called from a main.yaml. The one ...
Sumak's user avatar
  • 101
0 votes
1 answer
27 views

remove duplicate character from string in pure bash - works in CLI but does not work in script

I want to remove all duplicate minuses from a string using pure bash (no sed/awk/etc). This works great in CLI: s="com---strig-3-1080p-----mp4" echo "${s//+(-)/-}" com-strig-3-...
Putnik's user avatar
  • 914
0 votes
0 answers
21 views

Decrypting with gnupg

In Linux, I'm familiar with decrypting .gpg files at the command line. But it seems to me that if I want to save a decrypted file in the same folder from where the unencrypted file was, then I always ...
Paul Benson's user avatar
0 votes
0 answers
30 views

setfacl does not work on files in tmp

ls -ld /tmp drwxrwxrwt 17 root root 440 Feb 3 11:18 /tmp user1@debian:/tmp$ touch acltest0 user1@debian:/tmp$ ls -l acltest0 -rw-rw-r-- 1 user1 user1 0 Feb 3 11:22 acltest0 user1@debian:/tmp$ ...
achille's user avatar
  • 127
1 vote
1 answer
33 views

Runing a command as user is not the same as logging as the user and running the command

I am trying to get a way to execute a script from a root session, but I am having some trouble with it. I'll lay out the issue: I have a script that performs some tasks as the regular user 'kolterdyx',...
Ciro García's user avatar
0 votes
1 answer
33 views

anacron doesnt work as expected

Trying to schedule a job to run every day with cron or anacron. Search the forum for resolution but still without any success. Changing shell=/bin/bash or bin/sh didnt do anything. My system lubuntu ...
Surepic 342's user avatar
2 votes
1 answer
53 views

Running multiple commands in WSL2 / Ubuntu 22.04 from PowerShell

I have to run a chain of commands in wsl from powershell, I've stumbled upon this question while researching, but I cant use && with wsl (wsl "ls && ls" returns with bash: ...
DeNice's user avatar
  • 23
0 votes
1 answer
41 views

Make zsh behave like bash for commands without trailing newline

Have a look at the following demo: [user@host ~]$ zsh user@host:~/ > echo -n test user@host:~/ > bash [user@host ~]$ echo -n test test[user@host ~]$ echo -n is an example for a command, that ...
Daniel Schmitz's user avatar
0 votes
1 answer
21 views

Byobu - modify/pass environment variable in existing session on reattach

I'm experimenting with waypipe recently. I'm creating remote window like this: waypipe -c lz4=9 ssh user@host foot On creating new foot window waypipe denpends on environment variable $...
Kuń's user avatar
  • 1
0 votes
1 answer
52 views

Activate a conda/mamba environment when cd to a specific directory

Can I automatically activate a specific environment when cd into a directory? Like if I cd into the directory my_nn_library then automatically run mamba activate nn_env. I am using Ubuntu.
Osman Mamun's user avatar
1 vote
0 answers
33 views

How to command pv (Pipe Viewer) to work with diff?

using: OS: Kubuntu 22.04.3 LTS x86_64 diff (GNU diffutils) 3.8 Copyright (C) 2021 Free Software Foundation, Inc. pv 1.8.0 Copyright 2023 Andrew Wood, pv = Pipe Viewer commands to display above: ...
joseph22's user avatar
  • 345
4 votes
1 answer
78 views

Less --hilite-unread prints carriage return ^M on blank lines

When printing files with Windows line endings (CRLF), less shows carriage return ^M in blank lines when option --hilite-unread is used. Lines with any text display correctly, skipping the carriage ...
Paul's user avatar
  • 191
2 votes
0 answers
26 views

Setting GitHub Actions Secrets on Docker container build/run command, but encountering a parsing issue

I'm in the early stages of building an automated pipeline. Still in the exploring phase. Right now, I'm struggling with setting the environment variables for the container I'm going to run my app. The ...
Jorge Mauricio's user avatar
0 votes
1 answer
187 views

Syntax error near unexpected token ('

Please somebody inspect my code to see why I get syntax error near unexpected token (' I have been running this code several time but all I get the same error #!/bin/bash vcf_file_dir="/10/&...
Zizogolu's user avatar
  • 101
1 vote
2 answers
127 views

Linux shell command to replace path with file content

I have a file that includes a relative path in angle brackets, such as the following (example.txt): Some content containing <../another.txt> file Then in the parent directory, the file another....
Jeff G's user avatar
  • 390
0 votes
2 answers
38 views

Find and replace date with UTC date

I have file that looks like this: [2024-01-20 15:23:00] hello world [2024-01-20 15:42:00] bye [2024-01-20 15:43:00] foo bar ... Date in this file are in UTC+1 and I want to convert in to UTC I tried ...
sloppy's user avatar
  • 1
0 votes
1 answer
41 views

How to make bash script output compatible with both terminal and file?

In bash, if I want to produce periodical status messages, I can replace the previous one by emitting a hotkey combination, e.g. as seen here, here or here. When a user executes the script directly, ...
Zsar's user avatar
  • 233
0 votes
0 answers
40 views

Cannot activate Python virtual environment from within shell script (zsh)

I cannot activate a Python virtual environment from within a shell script (zsh). I have tried the following: #!/bin/zsh conda create -n myenv python=3.10 conda activate myenv It sends me the error ...
NilsK's user avatar
  • 135
3 votes
3 answers
564 views

Bash [[ test =~ regex ]] vs perl command result

Is the bash operator =~ equivalent to a perl invocation? filename="test-33.csv" regex="([^.]+)(-\d{1,5})(\.csv)" With bash test: if [[ "$filename" =~ $regex ]]; then ...
rellampec's user avatar
  • 133
0 votes
1 answer
25 views

pipefail over ssh in linux

set -o pipefail is not getting evaluated correctly on the remote host if the set command is used in ssh command. Example ssh hostname "set -o pipefail; false | true; echo $?" - gives 0 (Not ...
Praneeth Gudumasu's user avatar
1 vote
2 answers
345 views

How to use the `tax[13]-eq-dc` regex in a Bash loop?

The following regex tax[13]-eq-dc represents two servers, tax1-eq-dc and tax3-eq-dc. I'm trying to find a way to use it in a Bash do loop, but can't just get the correct syntax. E.g., the following is ...
boardrider's user avatar
  • 1,135
0 votes
0 answers
111 views

Permission denied error when trying to SSH through a script

I have a set of Bash scripts designed to establish an SSH connection from a local machine to a remote server through a middle server. The local script initiates a tunnel using socat, and the middle ...
FLSill's user avatar
  • 1
2 votes
2 answers
93 views

How to convert lscpu output to JSON format with no trailing spaces?

I tried to convert it to the JSON format by -J flag, but older lscpu versions have no such functionality. The solutions I've found here didn't help me. I want to put out here the solution I got from ...
palmasd1's user avatar
0 votes
0 answers
48 views

duplicate pane to show history in tmux

Sometimes, the output of a command is very long and thin, and my screen is much wider than it is tall. Is there any way to make a new pane which is a copy the current one, but more scrolled up so that ...
guest4308's user avatar
  • 167
3 votes
1 answer
302 views

Debian Bash Associative Array Self (Internal) Referencing

I'm attempting to contruct an associative array where key-value pairs within the array, reference other key-value pairs in the same array, using Debian Gnu-Linux 12.4, 22.12.3 and Bash 5.2.15. Example,...
njc's user avatar
  • 174
1 vote
1 answer
106 views

How to put more than one image by page using img2pdf?

I have a series of images (>100) that I want to print in a specific size, that size let me put 8 of the images in a page, but when running the next command I get one image by page. img2pdf *.png --...
rurickdev's user avatar
0 votes
0 answers
49 views

How to remove left-over files from an Homebrew installation

My current homebrew has its files installed in /opt/homebrew which is correct. However, I have several hundred leftover homebrew files in /usr/local/Cellar which are still symlinked to in /usr/local/...
Cliff Helsel's user avatar
2 votes
0 answers
66 views

Program is not interactive in NuShell

Some background Qemu has a wonderful feature, which allows you to connect its stdio streams to serial ports on the guest. This allows you to connect QEMU's stdio streams to a TTY shell on the guest ...
J-Cake's user avatar
  • 261

1
2 3 4 5
234