Questions tagged [bash]

Bash (Bourne-Again SHell), is the shell used in Ubuntu's command-line interface by default.

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

Unable to run git command (with ~/.bashrc modified)

I'm using powershell in Windows to clone a repository to an on-premise Ubuntu GPU environment (specifically, NVIDA-DGX). After successfully ssh, I followed an instruction and added the following codes ...
0
votes
0answers
13 views

What is the command to kill a specific bash script?

How do I kill a bash script without knowing the PID number? I've got Script 1 that sometimes runs from start to finish, and sometimes I end it early. I used to have Script 2 with a kill command that ...
1
vote
1answer
22 views

can't update any packages due to error in '/usr/sbin/update-info-dir'

I'm unable to update any packages in ubuntu due to an error in '/usr/sbin/update-info-dir' the error is given as: Setting up install-info (6.5.0.dfsg.1-2) ... /usr/sbin/update-info-dir: 9: export: : ...
0
votes
1answer
26 views

Can not delete chroot after aborting it's creation

I am trying to set up a chroot and I ran sudo qemu-debootstrap --arch=amd64 stretch /srv/chroot/focal-amd64 during the second stage i realized that I wanted focal, not stretch. Copy & paste error....
0
votes
1answer
22 views

How to bypass gnu grub minimal bash line error to boot from usb?

I tried to upgrade my ubuntu 16.04 into 18.04 but got into some error and now I can't login into it, so i was trying to install ubuntu 16.04 again by using usb. But when i tried to boot from usb that &...
0
votes
0answers
25 views

bash dialog select multiple options at once

I have Option 6 which depends on Option 5: If Option 6 is selected, Option 5 is also automatically selected. Option 5 can be selected independently of Option 6. If Option 5 is deselected, Option 6 ...
0
votes
1answer
40 views

Weird output while using sed to rename files

I am using Ubuntu 20.04.2 with GNU sed version 4.7. I have a bunch of music files that got named weirdly because they did not have all the info I specified to be in the file name. For example, "...
0
votes
0answers
27 views

Using systemd services to launch programs at boot, can view topics/nodes but can't subscribe

I have a master(Ubuntu18.04+Melodic on Jetson Nano) and slave(Ubuntu 16.04+Kinetic on PC) conected properly. I am able to run ros nodes and have full duplex without any issues when these nodes are ...
0
votes
0answers
52 views

Shell script not running properly from another shell script

I have bunch of shell script and need to run one by one from a single shell script and this single shell script is running from a C++ code. I just explain you the process .. I run my C++ application ...
0
votes
0answers
36 views

How to set up crontab in ubuntu 20.04?

I have written several backup tasks in crontab and I use rsync to do the backup. One of the backup tasks is as follows: 30 1 * * 6 root rsync -avz super@192.168.0.5::codelab /backup/gitlab --password-...
0
votes
0answers
42 views

How can i use readarray to capture output from software Digitemp?

Trying to figure out a way how to capture time and temperature values output from Digitemp software in to variables so i can change specific positions in array. Tried using readarray but don't ...
3
votes
1answer
37 views

GNOME Terminal bash line wrapping issue

Recently I noticed a strange issue when resizing the gnome-terminal window horizontally. There's a bug when wrapping the bash lines: the lines are replicated. I really don't know whether it's normal. ...
1
vote
1answer
33 views

Iterate over files withing

I have two folders, Controls and Patients within each of them there´s several folders, one of them called Runfirstall. I have the next code: DIR="/media/Roy/Analysis" for group in ...
-1
votes
0answers
15 views

How to use bash script to detect Virtual IP created by Keepalived is on the current computer?

Hi I'm new to Linux in general and I need helping writing a bash script that detects if the virtual IP created by Keepalived is on the current machine and if it is, then it'll execute an echo "...
0
votes
0answers
23 views

Error :“the command '/bin/sh -c source protected-env/bin/activate' returned a non-zero code: 127” while I'm trying to configure my first dockerfile

I'm trying to learn docker. This is my first experiment. I have written this dockerfile : FROM nvidia/cudagl:11.3.0-base-ubuntu20.04 LABEL Author="ZioMario" LABEL Title="Firefox/...
0
votes
1answer
33 views

Enter key does not execute command in python and bash

My enter key suddenly started triggering a history-search-backward action instead of running the typed command in python and bash shells, although it still behaves correctly on my zsh (default) ...
0
votes
0answers
19 views

For loop variable issue [duplicate]

I have created a custom script #! /bin/bash for i in {1..$2};do mkdir $1__${i} done $1 argument>> directory name type:string $2 argument>> index type:integer for creating multiple ...
0
votes
0answers
30 views

In ubuntu 18.04, how do I do these steps in the GUI through a shell script?

Open Unbuntu's [Settings] tool and find the [Sharing] page。 Turn on the [Screen Sharing] setting (the button in the upper left corner of the following page is set to [ON]) and set the password in the ...
0
votes
1answer
31 views

Migrating zip files to directories using certain label

Introduction: I'm a novice to scripting and made the decision to change from Windows to Ubuntu(Ubuntu 20.04.2 LTS) recently so I'm not familiar with many things. An explanation or advice would be ...
0
votes
1answer
20 views

less not displaying coloured output in konsole

I know that the -r or -R switch on the less command is used to show coloured output, but it only seems to work with the --color=always flag on the command that is generating the output, but not all ...
0
votes
1answer
30 views

Iterate over the files of a directory

When I want to iterate over the files of a directory (directory Runfirstall for example) I usually do: for folder in $DIR/Runfirstall/* However I found the next sentence in some code: for folder in $...
0
votes
1answer
40 views

How to display terminals with commands on startup

I'm trying to open 2 terminals on startup. One will execute one command, and the other one will execute a different command. I already tried using Ubuntu's Startup Applications program pointing to ...
0
votes
0answers
12 views

Rename files/folders using Mac Terminal [closed]

Would someone be able to help me with commands for Mac Terminal? I am trying to rename multiple file and folders like this: Folder: from: somePath/20191205 to: somePath/2019-12-05 Files: from: ...
0
votes
2answers
29 views

How do multiple && and || work with if statements

I know that && is AND, and that || is OR. But how do they work with each other when you have multiple of them? See (the statements are replaced with numbers): if 1 && 2 || 3 && ...
0
votes
1answer
27 views

Bash source + npm script function not exported but variable is

Can someone explain the difference in output when running the following on mac vs linux. test.sh #!/bin/bash testFunc(){ echo "test function"; } export -f testFunc; export testVar=&...
1
vote
1answer
42 views

How to continuosly update an ENV variable (eg PS1) inside a script that runs in the background?

The task is simple. I want to add a countdown timer to the prompt inside a bash script that is defined as an alias function in my .bashrc to make it run in the background when I need (eg "...
0
votes
0answers
26 views

bash - dialog command - “select all” button

The link below: https://serverfault.com/questions/144939/multi-select-menu-in-bash-script It correctly shows how to create a menu using the "dialog" command but does not show how to create ...
0
votes
0answers
23 views

How to use taskset with more than 128 cores?

I am using taskset with more than 128 cores. I know that a cpu with less than 32 cores can run the following: taskset -p 0xFFFFFFFF pid How do I present the other cores besides the 32 cores. Thanks.
0
votes
1answer
55 views

Trying to understand code in group project

There is a section of code I cannot understand base64 /dev/urandom | head -n 700 > NewFile.txt I understand the base64 is to encode binary to text, and dev/urandom is a random number generator. I ...
0
votes
0answers
39 views

Writing a bash script to see if a user is logged on

I am trying to write a bash script that will tell me whether or not a user is online or not. If the script does not receive the correct amount of arguments, it prompts for a valid userID. If the ...
-1
votes
0answers
29 views

SUV calculation (fslmeants) reference region has different size (x, y, z)

I'm currently trying to calculate the SUV using fslmeants from PET-scans which have been co-registered with T1-MPRAGE images to MNI152. I'm using whole cerebellum as the reference region and using the ...
0
votes
0answers
35 views

Permission denied when in root

I typed perl RunFrustratometer.pl cl10.pdb configurational on my ubuntu Then I got a problem showed that: sh: 1: /home/li6/frustratometer2/Scripts/AWSEMFiles/AWSEMTools/PdbCoords2Lammps.sh: **...
0
votes
1answer
47 views

Aliasing cd && echo doesn't work properly

I'm trying to create an alias that changes the directory and prints some content. I've wrote this line: alias test="cd ~/Documents/MyDir && echo 'content'" The result is: content ~$:...
0
votes
1answer
19 views

sudo -A ignoring my SUDO_ASKPASS variable

sudo -A ignoring SUDO_ASKPASS variable I have been using sudo -A and SUDO_ASKPASS for years without trouble. I have a newly installed Xubuntu Focal Fossa workstation and I cannot get sudo -A to work I ...
0
votes
1answer
52 views

-bash: No such file or directory when trying to run a .cc file in Ubuntu

I am trying to run a file called driver.cc, which is a C file. This C file calls a sort.h file. I am in the correct folder when I type the following: ./driver random 20000 less and I get the ...
1
vote
0answers
31 views

how do I get screen to show comamnds given?

I have a serial device that I am trying to figure out the commands for. I know the baudrate, and seem to be able to connect. Using $screen /dev/ttyUSB0 9600,cs8 the problem I have is that every ...
1
vote
3answers
53 views

Batch Rename DIrectory Using Pattern Matches

I would like to change this directory structure to the one following it. Although another directory batch rename question exists, this one is quite different. l '001. Aretha Franklin - Respect.mp3'* '...
0
votes
2answers
68 views

Change directory in current terminal with terminal file manager

Expectation: open lf or nnn; navigate to a desired location there; :q $PWD is the desired location. Reality: The state of the parent terminal is unchanged, directory change is local to the file ...
1
vote
1answer
40 views

If I execute a program via terminal it opens, but if I open it via .desktop file it doesn't

I've installed Matlab inside /home/user/Desktop/matlabFolder/bin/ . I can run Matlab running /home/user/Desktop/matlabFolder/bin/matlab inside a terminal, and it works. I created a .desktop file here: ...
0
votes
0answers
34 views

Overclocking AMD rx580 in ubuntu 20.04: failing to force state 2 memory clocks

I am trying to overclock a RX580 8Gb in ubuntu 20.04. I am following this https://www.reddit.com/r/Amd/comments/agwroj/how_to_overclock_your_amd_gpu_on_linux/ based principally in https://wiki....
0
votes
1answer
43 views

inconsistent bash behaviour

I have a windows 10 operating system on which I have installed WSL2 Ubuntu 20.04 in it. It is working fine, but I have some weird behaviour of bash i can't seem to be able to resolve. If i open bash ...
0
votes
1answer
36 views

Why do I need to source ~/.bashrc manually everytime when I connecting via SSH?

I'm using ubuntu 18.04 ,and use ssh to connect to my lab's server. But since a week ago, every time I open a terminal through ssh, I can't use conda activate *, it says don't have the command "...
-1
votes
0answers
51 views

GRUB Minimal bash-like editing is supported

I had Ubuntu 20.04 installed on my SSD and then I decided to remove it and install Windows 10. When I start my Windows installation I format all partitions and install Windows. But now I can't boot to ...
0
votes
0answers
18 views

Bash Alias for Firejail Sandbox

I’m wanting to make a bash alias to be able to run applications sandboxed in Firejail that will make a temporary folder that will disappear on reboot. Is this right? alias sandbox () { firejail --...
0
votes
1answer
39 views

Help! My bash script stopped working as intended!

I am trying to get a very basic bash script to work but the output for the history command stopped working properly!! This is the output #!/bin/bash -i history And that's the code Any ...
0
votes
0answers
51 views

20.04.2. Running basic commands like copy and executing shell scripts using runcmd of cloud-init file

#cloud-config autoinstall: apt: geoip: true preserve_sources_list: false primary: - arches: [amd64, i386] uri: http://us.archive.ubuntu.com/ubuntu - arches: [default] ...
0
votes
1answer
24 views

Run bash script in a separated process (dettached from SSH/Putty) [duplicate]

I'm accessing Ubuntu Server from a putty terminal and then I run this test.sh script from that terminal: $ bash test.sh & (note the &) #!/bin/bash while true do node myscript.js wait ...
0
votes
2answers
62 views

Removing a block of text (saved in variable) inside file

This may sound like a question that'd be answered multiple times on google, and it is. But strangely enough, I can't find any answer that actually works (I'm a bit suprised by it)! Lets say I have a ...
2
votes
1answer
49 views

How to use the “find” command to find files bigger than 1MB, and execute a chosen command on each file?

I'm trying to write a script that will find all files bigger than 1MB, and one at a time ask the user what to do with each file: delete, compress, or skip. So far this is what I have got: find / -type ...
1
vote
0answers
26 views

Strange sequence of characters in terminal after each restart

After upgrading from Kubuntu 20.04 to 20.10 on my laptop, after each reboot, if I open the terminal, there is the following sequence written on the prompt: 65;1;9c Where could something like that be ...

1
2 3 4 5
194