Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
-4 votes
4 answers
97 views

I'm working on the following pipeline (codeshare.io/243VJE): #!/bin/bash #SBATCH --nodes=1 --ntasks=1 --cpus-per-task=10 #SBATCH --time=2-00:00:00 #SBATCH --mem=40gb # #SBATCH --job-name=pan_pca #...
5 votes
3 answers
901 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}...
-1 votes
1 answer
2k views

My goal is to run a script in crontab and save its output (via echo commands) to a log file. Thus, I am using the following: $HOME/folder/sh/script.sh 1>$HOME/folder/logs/script.log 2>$HOME/...
4 votes
5 answers
7k views

I've recently started to learn the dvorak keyboard layout, but I still need to use qwerty sometimes. I'm looking for a script to toggle between the two keyboard layouts. Also, I'd like to invoke ...
2 votes
1 answer
2k views

I am trying to automate a few steps that I need to execute in a remote linux machine from my local ubuntu computer. My shell script is as follows :- #!/bin/sh ssh XYZ ' qlogin -l cuda=1 ' When I ...
6 votes
2 answers
743 views

$ sleep 1234& $ sleep 12345678& $ %sleep\ 1234 bash: fg: sleep 1234: ambiguous job spec $ jobs [1]- Running sleep 1234 & [2]+ Running sleep 12345678 & ...
36 votes
4 answers
37k views

I have a file with ANSI colors. test.txt: \e[0;31mExample\e[0m I would like to display the content of this file in a terminal, like cat does, but I would like to display the colors as well.
6 votes
3 answers
577 views

I'm in the following situation > ls H9/ HG01109_chr1_hap1_contigs.list HG01952_chr1_hap2_contigs.list HG02572/ HG03486_chr1_hap1_contigs.list ...
2 votes
1 answer
217 views

I am attempting to load a python script that launches a Firefox Geckodriver under Selenium whenever a specific kiosk user logs in to the GUI. I've tried launching this via .profile, however ...
0 votes
0 answers
21 views

The situation: I've been converting my family to Linux for quite some time now. I'm currently in the process of replacing their Roku with a Media PC (in this specific case, Pop_OS! 24.04 using Wayland ...
0 votes
0 answers
47 views

Description I have two Raspberry Pi OS 13 (Trixie) systems with identical Bash versions and identical /bin/bash binaries (verified with md5sum). On one system, running bash -l sources ~/.bashrc as ...
40 votes
7 answers
190k views

I have two similar scripts with different names. One works fine but other throws error. Can anyone please tell me what is the issue? This is my test.sh scripts which works fine [nnice@myhost Scripts]$ ...
37 votes
7 answers
20k views

I'm running this loop to check and print some things every second. However, because the calculations take maybe a few hundred milliseconds, the printed time sometimes skip a second. Is there any way ...
0 votes
0 answers
43 views

I have a little maintenance thing to do as super user, from time to time. I would like that to be a one-liner, for easy copying from my self-documentation to a terminal. I reduced it to the bare ...
2 votes
5 answers
7k views

Is there a way to add an alias from the command line without directly editing the bash_aliases file? To clarify, how can I make a bash script do it without having to enter something along the lines of ...
0 votes
0 answers
36 views

I created this function, which is supposed to allow an interactive selection of an mDNS hostname, and then connect to it via ssh. Yet, whatever I try, the host variable is only available in side the ...
63 votes
4 answers
55k views

If script.sh is just something typical like #!/bin/bash echo "Hello World!" Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable?
2 votes
1 answer
682 views

I want pwd to return /path/to/dir in the format /path/to/dir/ with the "/" at the end. Any ideas as to how I can accomplish this?
25 votes
5 answers
7k views

I'm typing that command and my cursor is at the end of "supprimer des warnings" $ git commit -m "Nettoyage : > - Suppression de sources ou projets inutiles > - Corrections ...
0 votes
1 answer
71 views

I have just pasted a line into the bash shell. It contains embedded newlines. CTRL+a gets me to https at the start. CTRL+e gets me to 7d87 at the end. How can I move around from line 1 to 2 to 3 ...
3 votes
2 answers
350 views

I'm writing a script and I'd like to use set -o pipefail on shells that support it. Dash does not support that option. Usually, || true lets me swallow errors, but not in case of set: > podman run ...
0 votes
4 answers
6k views

From a bash shell script, I am creating a folder and storing the mysqldump there. I am sure that there is no command related to permissions in my script. To allow an other user to access these files, ...
4 votes
2 answers
146 views

I want to power on the computer and have a Bash script to open all my programs in different Gnome work spaces. For example: Open text editor and CLI in the first work space. Open web browser A in ...
1 vote
1 answer
46 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 ...
3 votes
2 answers
8k views

I need to export proxy on RHEL 7 with the current logged user credentials. I am able to achieve this by adding manually in .bashrc or .bash_profile.: export http_proxy=http://username:password@proxy....
0 votes
1 answer
2k views

When I first created my .inputrc (it didn't exist by default), I set vi-ins-mode-string to "+" and vi-cmd-mode-string to ":" to differentiate between modes. I didn't have "(cmd)" or "(ins)" prepended ...
2 votes
2 answers
3k views

I'm trying to add the ability for my ArchLinux installer script to check if it's update-to-date based on rather it matches (or doesn't match) the version number that's on gitlab. The primary script ...
14 votes
3 answers
12k views

I recently became aware of readarray in Bash v5. Is there an equivalent for zsh?
0 votes
2 answers
2k views

I am facing an error when run $ source ~/.bashrc. The error is /usr/share/bash-completion/bash_completion:1512: parse error near `|'. bash_completion file (the first line is 1512) : if ! [[ &...
15 votes
2 answers
8k views

The common coreutils base64 tool can't encode/decode base64url. The = padding is optional in base64url and the last two characters of its alphabet are - and _.[0][1] What is a simple way to encode and ...
0 votes
1 answer
77 views

I just rebooted one of my systems for the first time in several months, restarted tmux and my usual set of bash shells for tailing various log files, and noticed that running fg n (i.e. fg followed by ...
2 votes
3 answers
208 views

I have a script that parses command line arguments. The intro to the loop to iterate over the argument array looks like this: for arg in ${args[@]+"${args[@]}"}; do Can someone explain this ...
3 votes
6 answers
433 views

I've tried using sed for this. I've tried putting the lines of interest in variables as well. I have two examples I want to achieve for now. Lets say I have thousands of urls in a file called links....
1 vote
2 answers
663 views

I would like to know if there are any kinds of packages dedicated to ASCII graphics, like drawing lines and plotting points using characters in terminal. I already made a script for plotting points ...
1 vote
1 answer
5k views

Here is my command line for python: python script.py -a .faa -n .fna I have a directory containing multiple directories. Out of these multiple directories, there could be 1 or more folders. In ...
5 votes
2 answers
2k views

Something that's bothered me for many years is that if I want to search my shell history for commands which were run as root, I have to check two different locations: I have to check /root/....
4 votes
1 answer
2k views

I'm new to Unix command. I was trying to execute the following commands in Git Bash and it directs to error message: paste: /dev/fd/63: No such file or directory # Set Up Image Lists paste <(awk &...
3 votes
0 answers
840 views

Updated Just booted the PC and now it works. >echo $SHELL /bin/bash Very strange. Logging out and back in was not enough. Just installed new CachyOS linux on new PC (not virtual box) I looked at ...
0 votes
0 answers
71 views

Hex memory dump is Docsis config file. Is it possible to convert this hex dump info valid Docsis config file? Preferably, using Perl and DOCSIS::ConfigFile module. (or Python scripts, python-docsis). ...
10 votes
1 answer
10k views

I have a folder ~/TestFolder. The current working directory is the home directory(~). I want to enter a partial command, for example cd test, and I want it auto filled to give the command cd ...
51 votes
5 answers
91k views

I want to do a bash script that measures the launch time of a browser for that I am using an html which gets the time-stamp on-load in milliseconds using JavaScript. In the shell script just before i ...
8 votes
3 answers
10k views

Someone could answer me how make one prompt via pkexec when I've to use two command with authentication? My easy sample script: pkexec virsh net-start default; pkexec "/home/user/program"; I'm new in ...
4 votes
1 answer
4k views

I don't understand why "${ARRAY[@]}" gets expanded to multiple words, when it's quoted ("...")? Take this example: IFS=":" read -ra ARRAY <<< "foo:bar:baz" for e in "${ARRAY[@]}"; do echo $...
1 vote
3 answers
5k views

When I try executing a *.sh file, I can run it from terminal, but not when double-clicking it form the file manager. The commands chmod +x Test.sh and chmod -x Test.sh dont seem to work. Every time I ...
28 votes
7 answers
76k views

How can I show spinner till command line finish it is job? In other words, If I am running a script and I want to show spinner while this script is running and the spinner disappears when the script ...
1 vote
1 answer
117 views

While experimenting with GNU parallel I found that the following cases all hang with decreasing CPU usage on a Fedora 41 VM with 8GB RAM. Is this expected behaviour? parallel --halt now,fail=1 --...
0 votes
1 answer
2k views

I am trying to access the docker image labels from Python as follows hostname = socket.gethostname() cmd = "sudo curl --unix-socket /var/run/docker.sock http:/containers/" + hostname + "/json" output ...
3 votes
3 answers
917 views

The following script is supposed to check $1 and see if it is a specific value. It only works when one Bash [[... =~ ...]] regex check is passed in an if statement. The error is: When more than one ...
1 vote
1 answer
2k views

I am a student and struggle mightily with creating my own scripts. Generally, I can do a bang up job script-kiddie-ing and adding on to what someone else has done following the provided information ...
4 votes
1 answer
223 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&...

1
2 3 4 5
546