Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
2 votes
1 answer
132 views

I maintain an extension for the Bash environment called Basta. Basta provides a scroll-protected status line at the bottom of your ANSI/VT100 terminal. When Basta sets itself up, the effective number ...
Kaz's user avatar
  • 8,907
4 votes
3 answers
755 views

The 'here string' (<<<) is a useful construct, and can be used in lieu of echo in many situations. However, when calculating a hash (as one example) the addition of a newline character ...
Seamus's user avatar
  • 3,928
0 votes
0 answers
99 views

when it comes to the echo -e command, of course you can do a lot with it when it comes to printing color text, especially when it comes to making terminal based UIs, but I have one main question, does ...
AuraWare's user avatar
1 vote
3 answers
165 views

In Bash for macOS, I need to be able to pass a string to a function and return the value of a variable named after that string, as well as the string itself. Here's what I have so far, which doesn't ...
seagull's user avatar
  • 111
12 votes
3 answers
2k views

This works head -c 10 /dev/zero | sed 's/\x0/x/g' and generates xxxxxxxxxx as expected. Then I tried this: sed 's/\x0/x/g' /dev/zero | head -c 10 which seems to just hang. Then I thought, oh, sure, ...
Enlico's user avatar
  • 2,362
6 votes
2 answers
741 views

I acknowledge there are superficially similar questions asked here before, but all of those I've seen are simpler than what I'm trying to achieve. Bash-only solutions are preferred. I have a variable ...
user648855's user avatar
4 votes
1 answer
95 views

In Classic Shell Scripting from O'Reilly, Arnold Robbins and Nelson H.F. Beebe write the follwing example: $ umask 023 $ rm -f foo $ cp /bin/pwd foo $ ls -l /bin/pwd foo -rwxr-xr-x 1 root root ...
Enlico's user avatar
  • 2,362
2 votes
1 answer
338 views

I'm trying to unzip a file in a bash script, but I get a 'Segmentation fault (core dumped)' error following a repeated output message of 'Unzip agent files.' Unzip agent files. Unzip agent files. ...
Chris Pavey's user avatar
4 votes
2 answers
187 views

I have found multiple posts regarding color in bash terminals - but I was wondering if there was a way to verbosely print out the color code along with a sample of that color in order of hue. Right ...
Barry Chapman's user avatar
0 votes
0 answers
42 views

I have a shell script that I want to run many times. Each time, I want to use a different argument that comes from a CSV file. The file is very simple: code1-code2-01 code1-code2-02 code1-code2-03 ...
David Orozco Cosio's user avatar
0 votes
3 answers
133 views

I face a situation that features Bash scripts on a Linux installation that asynchronously run system tools with a delay, via a ( sleep 10 ; some_command ) & construct. The scripts that perform ...
AdminBee's user avatar
  • 23.6k
-5 votes
1 answer
56 views

Tasks: as alpha-user: Create a new simple BASH script file and set SUID permission. Check if the SUID bit is set on the file. Run the file as beta-user to verify that it executes with the owner's ...
fatima khan's user avatar
0 votes
1 answer
118 views

...that is to say, is there a means by which I can read the full command that's being evaluated AS it's happening? Here's a contrived example, but one I feel makes the question clear: function ...
NerdyDeeds's user avatar
2 votes
1 answer
335 views

I am using linux (Ubuntu) and bash. I made a simple Go program. Literally infinite for-loop that prints text every 20 seconds. package main import ( "fmt" "time" ) func ...
Yakog's user avatar
  • 517
0 votes
1 answer
129 views

I try to make a simple script that pings a network connection: #!/usr/bin/env bash # Xdebug ip detector for docker # Copyright (C) 2023 Dimitrios Desyllas # # This program is free software: you can ...
Dimitrios Desyllas's user avatar
1 vote
1 answer
98 views

Normally, we can pipe stdout to stdin as follows: echo "This is going to stdout" | grep -o going Suppose instead of grep I wrote a script that reads from both stdin and fd3, and then ...
merlin2011's user avatar
  • 4,209
2 votes
1 answer
163 views

The following code should demonstrate and help with testing inefficient Pattern Matching expressions in a Parameter Substitution for a newline-separated strings var vs. array. The goal is to achieve ...
fozzybear's user avatar
0 votes
1 answer
54 views

From the manual of rpl the -s option enable the dry-run mode, that is it simulates the substitutions without changing the real files. If I try it I get the following output: $ rpl --dry-run 'JLCPCB ...
Mark's user avatar
  • 805
4 votes
1 answer
371 views

After re-installing a Linux machine, I inadvertently ran wipefs -a on the installer pendrive: $ wipefs -a /dev/sd? /dev/sda: 8 bytes were erased at offset 0x00010040 (btrfs): 5f 42 48 52 66 53 5f 4d /...
Fravadona's user avatar
  • 1,668
0 votes
0 answers
114 views

I want to change the playlist of music in Rhytmbox at some specific time, while the application is already running. I have started with a simple bash scripts, to launch each playlist: #!/bin/sh kill $(...
Fabio's user avatar
  • 565
1 vote
1 answer
142 views

I have a simple bash script that's supposed to create a dump file from a database docker exec -i container sh -c "mongodump --archive" > \ ~/dumps/db-$(date + "%d%m%Y").dump ...
Ambre's user avatar
  • 111
3 votes
2 answers
426 views

I have a bash script that I need to be able to start from either: cron an interactive (logon) shell This script needs to know whether it was started from cron, or started from an interactive shell. ...
Seamus's user avatar
  • 3,928
1 vote
1 answer
145 views

I was trying to solve the problem in this post, and it seems like xattr -cr . is not actually removing the com.apple.FinderInfo attribute, nor is xattr -c <filename> or xattr -d com.apple....
Julian Flack's user avatar
0 votes
2 answers
212 views

Im finding great difficulty in adding a new line character to my bash alias in my ~/.bashrc file alias mip="curl ifconfig.me/ip" I want a newline to be inserted after the above script, so ...
Rachel1983's user avatar
0 votes
1 answer
146 views

I have a bash script which logs into my bitwarden instance using the bw cli, in the following way: test.sh: #!/usr/bin/sh set -e -o pipefail bw logout --quiet || true BW_CLIENTID=$(cat ./credentials....
Christian Eriksson's user avatar
1 vote
1 answer
183 views

I was asked by @terdon to post this follow-up to a more specific issue I had and resolved over here. Apparently my choice of tools has not been a particularly smart one, so I shall describe the use ...
Zsar's user avatar
  • 121
0 votes
0 answers
120 views

When running a long-running command in the background over SSH from a non-interactive shell script, I noticed the process continues running on the remote machine without using nohup, disown, or ...
phip1611's user avatar
  • 101
0 votes
1 answer
108 views

I need to sum up the numbers, carry forward the values and store in a variable on if/else condition in a loop in linux bash. I am only getting the last iteration value but not the whole sum. In the ...
Kishan's user avatar
  • 113
0 votes
1 answer
138 views

What exactly are the steps from the moment I start the pseudo-terminal (CTRL+ALT+T) to the moment the shell starts listening for keyboard input? I know that it roughly goes in the way that the ...
Yakog's user avatar
  • 517
2 votes
1 answer
266 views

I'm trying to calculate the -o value for extracting an .AppImage file using unsquashfs on foreign architectures/OSs , but using objdump instead of readelf to make the solution more compatible with OSs ...
tresf's user avatar
  • 365
1 vote
1 answer
68 views

I need to assign a command to a variable and execute it with variable in linux bash. The command executes fine from command line but not from the variable because of multiple quotes. I hope backslash ...
Kishan's user avatar
  • 113
0 votes
0 answers
25 views

I was using ChatGPT, it genereated code with errors that I needed to fix. Now it seems that the code is correct: #!/bin/bash root_dir="$HOME/Zdjecia/Artykuły/" earliest_date="" ...
jcubic's user avatar
  • 10.5k
0 votes
0 answers
90 views

I recently changed my PS1 in my .bashrc and I notice that my prompt has problems when the command line has more characters typed into than the number of columns of my terminal window. I also ...
muggi's user avatar
  • 769
1 vote
1 answer
65 views

I would like to call a dialog box from a bash script and have the value returned. I tried set l = `xmessage -buttons Ok:0,"Not sure":1,Cancel:2 -default Ok -nearmouse "Is xmessage ...
OtagoHarbour's user avatar
1 vote
2 answers
187 views

I have the following two simple programs. Parent: package main import ( "fmt" "syscall" ) func main() { attr := &syscall.ProcAttr{ Files: []uintptr{0, 1, ...
Yakog's user avatar
  • 517
0 votes
1 answer
71 views

I have an ssh .sh bash script file i'm running on a cron to check website status. The bash script (when ran) refers to a local txt file for a list of websites to check if they're down or up. ...
sven30's user avatar
  • 103
2 votes
1 answer
214 views

I did the following yesterday night (before midnight of Sunday in Germany): Today's date $ LC_TIME="en.GB.UTF8" date --iso-8601 2025-01-12 Today's date (day of the week $ LC_TIME="en....
Porcupine's user avatar
  • 2,176
-2 votes
2 answers
339 views

I was plodding along, working on a shell script, and I've just learned something that I found surprising. I'm presenting it here as a Question because I'd like to learn if there's some way to avoid ...
Seamus's user avatar
  • 3,928
6 votes
3 answers
1k views

The bash shell expands unset parameters to the empty string by default. However, I can't find official documentation stating this anywhere. Is it?
Stanley Yu's user avatar
1 vote
6 answers
399 views

I have a lot of webpages saved in my Download folder and I want to move all html files together with its folder (for every "NAME.html" exists "NAME_files/" folder). The big ...
Antonio's user avatar
  • 203
0 votes
1 answer
197 views

I started learning about linux tty(s) and signals and ran into some trouble. I am reading and using The TTY demystified as a reference. I made two simple golang programs. Parent: package main import (...
Yakog's user avatar
  • 517
0 votes
2 answers
116 views

When using the command echo $100, I got the output 00 while if I give echo $d00 as the command, it gives an empty line! Why? Is there a way inside for the bash to interpret the two differently?
KeShAw's user avatar
  • 23
2 votes
2 answers
1k views

On Kubuntu Linux, The Google Chrome browser adds a checksum to the file, preventing simply editing the file by hand. So I'm writing a script to add the checksum. $ cat .config/google-chrome/Default/...
dotancohen's user avatar
  • 16.6k
0 votes
1 answer
99 views

I have the following simple script that changed ownership on folders more hola_config.sh #!/bin/bash chown -R hola:pola /home/darna chmod -R 775 /home/darna in /etc/sudoers I added the following ( ...
yael's user avatar
  • 14.1k
12 votes
2 answers
2k views

I need to run multiple shell scripts sequentially (s1.sh, s2.sh, s3.sh) with the following requirement: If a script produces no output (stdout or stderr) for 1 minute, it should be terminated After ...
Just a learner's user avatar
2 votes
1 answer
348 views

I have a bash script that opens a window with notify-send. I would like to close that window when the script ends, but I can find nothing to kill. The question is a duplicate of https://askubuntu.com/...
Peter Bill's user avatar
1 vote
2 answers
237 views

I am trying to run a script which calls another script, but it does not seem to return to the script that called it. The source script "backup-plex.sh" calls “Linux_Plex_Backup.sh” (whilst ...
John's user avatar
  • 47
3 votes
3 answers
246 views

Regarding the command cmd1.sh | grep "message", in which cmd1.sh is as below #!/bin/bash echo "message from foreground father proess$(date)" setsid sleep 100 & echo "...
Qiu Yangfan's user avatar
1 vote
1 answer
143 views

I have three small questions regarding the mode the terminal is in when bash is listening / waiting for my commands: When bash is waiting for my command, is it running on a terminal that is in ...
dassd's user avatar
  • 113
0 votes
1 answer
251 views

I recently started learning about Operating Systems and the linux kernel. I was interested in terminals, so I started there, however, I quickly ran into a problem. I wrote a slightly longer question, ...
Yakog's user avatar
  • 517

1
5 6
7
8 9
546