bash Questions
4
Solved
I've seen lots of posts/answers on how to display all of the local commits for all local branches that have not been commited.
I have a narrow use case, and have not found an answer.
I need to dete...
4
Solved
I'm trying to add a SSH key to a GitLab pipeline. The SSH key is in ED25519 format and saved as a group environmental variable and as a file in GitLab. When I saved the contents of the SSH key in G...
2
Solved
I am looking for some tool that will dump total disk I/O by a single process after it ends.
So far my finding is :-
iotop= It shows i/o per process in real time but does not give
total after proc...
4
Solved
As explained in this answer, the "right" way to check if a variable is set in bash looks like this:
if [ -z ${var+x} ]; then
echo "var is unset"
else
echo "var is set to '$var'"
fi
What I'm in...
Transfuse asked 27/5, 2017 at 19:59
5
Solved
The utility which will find a program on the path but what about an arbitrary data file?
I must be searching for the wrong stuff but I can't find any way to do this with a standard utility so I th...
8
Solved
I'm trying to get trim off trailing decimal zeroes off a floating point number, but no luck so far.
echo "3/2" | bc -l | sed s/0\{1,\}\$//
1.50000000000000000000
I was hoping to get 1.5 but some...
Akilahakili asked 4/5, 2015 at 15:21
2
Solved
I'm currently using Bash on Windows 10 in my Visual Studio Code. The bell ring is extremely annoying and I would like a good solution to disable it (other that turning the volume off or not making ...
Dodi asked 15/10, 2017 at 15:2
3
Solved
To test if a variable is read-only, there are the following ugly hacks:
# True if readonly
readonly -p | egrep "declare -[:lower:]+ ${var}="
# False if readonly
temp="$var"; eval $var=x 2>/dev...
Frere asked 14/12, 2010 at 15:36
4
Note:Overwriting of the symlinks occurs from tar version 1.27 or higher
Below I am trying to show what exactly the problem is.
contents of the dirtmp1
file1.txt
file2.txt
code to create the ab...
4
Solved
I've got a strange problem. After I enter my password on a debian 6.0 system, I get the motd but then there is a 5-10 second pause until I get a shell prompt. If I press ctrl-c during that pause th...
Thalassic asked 7/12, 2011 at 10:39
3
Solved
Im in windows terminal and I would like to open directories in file explorer, while in WSL2 Ubuntu.
I tried typing "explorer.exe Desktop/", but it opens Documents, in fact every tim...
Odor asked 3/10, 2021 at 16:12
5
Solved
I am using sed command to insert an xml element into the existing xml file.
I have xml file as
<Students>
<student>
<name>john</>
<id>123</id>
</studen...
5
Solved
So, I'm working with Github Actions on end-to-end testing. The setup I'm looking at is having one job retrieve a list of urls to be tested, and my second job creates a matrix with that list and tes...
Redon asked 12/7, 2022 at 13:54
2
Solved
This error is showing after running this command: sudo systemctl status [email protected]
[email protected] - PostgreSQL Cluster 10-main
Loaded: loaded (/lib/systemd/system/[email p...
Interpose asked 1/12, 2020 at 14:34
3
Solved
I want to lint all the files in the current (recursive) directory while printing out only files that have an error, and assign a variable to 1 to be used after the linting is finished.
#!/bin/bash...
Void asked 3/1, 2018 at 20:30
3
Solved
running a container-job in an azure pipeline, I use a docker image ( conan ) which expects the build commands to be run under conan.
While I'm able to bootstrap the container in azure with --user r...
Parallelogram asked 31/12, 2019 at 13:32
3
Solved
After "upgrading" to Mavericks and Xcode 5, I have a variety of minor problems to deal with to make Xcode compile some of my older projects.
It appears that Xcode is passing a new argument to the ...
Izzard asked 4/2, 2014 at 2:43
3
Solved
I am seeking a terminal command to recursively go through folder structures and either delete .htaccess files with permission of 0444 and/or if possible to match the first line in the file for a sa...
2
Solved
I was wondering if there is an easy way in bash to break up a large array into several smaller ones.
I currently am thinking something like this:
for ((i = 0; i<= (bigArrayLength/2); i++)) do ...
2
Solved
When I am running Git Bash, I occasionally accidentally press CTRL+I and this freezes up the terminal for quite a long time, before releasing.
I have tried CTRL+D, CTRL+Q, CTRL+C thereafter,...
4
Solved
2
Solved
docker system prune wants answer y/n. How to i pass in shell script
my shell script
#!/bin/sh
docker stop registry
docker system prune
docker run -d -p 5000:5000 --restart=always --name registry -v...
3
Solved
One day, I typed the command
echo "\033[32mHELLOBASE\033[m"
in the gnome bash shell. The terminal showed me a green HELLOBASH string.
I found this interesting. From my experience and serveral te...
Nimitz asked 1/6, 2015 at 15:54
6
I am making a bash script and I have encountered a problem. So let's say I got this
function create_some_array(){
for i in 0 1 2 3 .. 10
do
a[i]=$i
done
}
create_some_array
echo ${a[*]}
Is ...
Orthicon asked 12/2, 2013 at 18:24
3
I have a fairly good amount of knowledge with Batch. I'm trying to port a batch script over to Mac/UNIX, but my batch file has a drag-and-drop thing to it. Through countless Google searches, I have...
Tribute asked 27/4, 2013 at 23:19
1 Next >
© 2022 - 2024 — McMap. All rights reserved.