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
-2 votes
0 answers
17 views

Sometimes bash does not honor new line in Ubuntu 22.04 [closed]

I have upgraded from Ubuntu 20.04 LTS to 22.04 LTS. Everything works, but sometimes when I run my commands in the bash terminal, the new lines are messed up. It happens intermittently. I saw Ubuntu 22....
  • 97
0 votes
0 answers
35 views

crontab sees bash script running while it is not

I have a python file which should ideally run at all times. However, sometimes it crashes, so I would have to start it again. Therefore, I have a cronjob that should try to run every 5 minutes (if it ...
  • 101
-5 votes
0 answers
18 views

In CodeSandbox.io, how do you script in javascript in codesandbox.io? [closed]

#Coding question!# Hello, I have more questions like these. How do I script in javascript with CodeSandbox.io? Would I still have to manually link using the script tag? Or would it automatically do ...
  • 1
0 votes
0 answers
16 views

Error in console when open a web browser from a bash script [duplicate]

Im trying to write a very simple script. It should to open a web-browser (www.google.com for instance), wait for 3 seconds and kill the web-browser. What happens to me is that seems that the script do ...
  • 113
2 votes
1 answer
33 views

Command 'Go' not found after installing on WSL with Ubuntu 20.04. Go is in $PATH

I've been struggling with this (seemingly) straightforward installation. If I run echo $PATH I get the following as part of the output /usr/local/go/bin:/usr/local/go-1.19.2/bin. What's even more ...
-1 votes
0 answers
43 views

Bash Script Curl with variable isn't working

I'm trying to make API connected bash script. This bash script asks inputs to users, then executes curl command with api connected website. This api is working when I paste it on my Browser, but not ...
  • 347
0 votes
0 answers
15 views

Github and private channel

i tried to execute this bash command: verweb=`sudo wget -q -O- 'https://github.com/Kitware/CMake/releases/latest' | grep -o 'https[^\"]*' | grep tag | grep -o -P '(?<=tag/v).*(?=&quot;,)' |...
0 votes
2 answers
29 views

Failed to execute child process “-bash”: Failed to execve: No such file or directory

What is the problem about Terminal? Anyone help?
0 votes
1 answer
34 views

Wait for process with name to spawn in Bash

I want to write a Bash script that runs in a background, waiting for a command to spawn. Suppose I ran script.sh which waits for ls. After I run ls, it should trigger actions?
  • 54
0 votes
1 answer
32 views

Failed run a user's alias inside bash CLI

How can run a user's alias $ grab 'man' but as to do in a CLI $ bash -c "grab 'man'" bash: line 1: grab: command not found Please show the fixing way
1 vote
2 answers
25 views

WSL Ubuntu cycles through Agend pid #'s endlessly until I press cntrl c on startup or login

I've got an ubuntu installation that is running some software for my company, and I've added some paths to the .bashrc file. When I start WSL with wsl -b ubuntu, it prints out this, and keeps going ...
-4 votes
0 answers
27 views

shell command to run a compiled program and save the output in a new file [duplicate]

what is the shell command to run a compiled C file and put the program's standard output into a new file.
0 votes
2 answers
62 views

How to get apt-get "Configuration Item" list?

I want to get them all, which I can't from the man apt-get and man apt.conf commands, not even looking for them online. In the manual, for example there is no APT::Get::Clean and putting a bogus ...
0 votes
0 answers
27 views

ldd reports not a single dependency, even when at least one library is missing

The ldd on my system is a script: $ ldd --version ldd (GNU libc) 2.35 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO ...
  • 11
2 votes
1 answer
387 views

How can I write a .sh file that modifies the Ubuntu kernel boot parameters?

I know that GRUB kernel boot parameters, for example panic=-1 can be added by sudo nano /etc/default/grub and then sudo update-grub. My application comes with a setup.sh shell script that sets ...
0 votes
1 answer
27 views

I need some help and clarify with Python Environment that should communicate with a scripted installer of an SDK

Ubuntu 22.04 (like all other previous versions), comes out with Python already installed by default, in fact if I open the Terminal and type: cris@cris:~$ python3 -V Python 3.10.6 So, Phyton is there ...
  • 121
1 vote
2 answers
37 views

Simulate the commads of a given bash script

i'd like to know if there's an utility to print only what the executed commands will be from a bash script, without actually executing it. A term for this would be a "dry-run". I know I can &...
  • 111
1 vote
0 answers
15 views

wine: chdir to /prefix : No such file or directory

I am trying to install an old free version of adobe illustrator in an Ubuntu 20.04 desktop machine but running into an issue with wine installation. This is the repo for the Adobe program: https://...
  • 111
8 votes
1 answer
874 views

Is there a way to make my Ubuntu PC sleep and wake up at certain times all the time?

I basically want to have my PC sleep and also wake up at a specified time all the time forever. With research, I did find out about rtcwake but as far as I know it's basically a one time use that I ...
  • 185
2 votes
1 answer
212 views

I can't execute ./bin/elasticsearch on ubuntu 20.04

When I run ./bin/elasticsearch command, I get the following error: ./bin/elasticsearch-cli: line 14: /home/samira/elasticsearch-8.4.2/jdk/bin/java: cannot execute binary file: Exec format error ./bin/...
3 votes
1 answer
293 views

How do I echo a file path after interpreting characters like dots '.' and tildes '~'?

I want to write a bash script that accepts, as an input argument, a file specification that includes one or more uses of the special characters ., .., and ~. I want my script's output to echo Bash's ...
  • 45
-1 votes
0 answers
43 views

Creating a script for installing apt packages [closed]

I'm trying to get an module check on my rangeforce linux challenge but it won't let me achieve it. These are the instructions: Create a Bash script on the server named milwaukee.sh into the /root/ ...
0 votes
1 answer
29 views

xdotool windows tilling 3 x 3 grid

What I want to do? I want to be able to click on a window (terminal window, any software window, etc...) to activate it and click on a shortcut key which will resize and move the active window to a ...
0 votes
1 answer
31 views

bash: /home/vishal/.bashrc: Errors when opening terminal

Everytime I open my terminal , this message pops up. Please tell how to permanently delete this from the terminal? bash: export: `=': not a valid identifier bash: export: `/home/vishal/LLVM/llvm-...
0 votes
1 answer
36 views

How to delete the commands that pop up after opening the terminal in Ubuntu 20.04?

enter image description hereenter image description hereEvery time I open a new terminal tab, some startup files try to send commands. And I get this: What should I do? It's a bit annoying.
0 votes
0 answers
13 views

Forward script input files when run over ssh

A script can be run on a remote machine via ssh: ssh login@host 'bash -s' < myscript.sh https://stackoverflow.com/a/2732991 If the script reads some input file (.txt, .csv) or invokes other scripts ...
  • 613
-1 votes
2 answers
32 views

Shell file execution on crontab is not working

When I try the command sudo /bin/sh /var/www/domain.com/file_sync.sh in the terminal, It is getting executed successfully without any errors. But when I try to execute the same command from crontab it ...
0 votes
0 answers
15 views

-bash: ./installer: cannot execute binary file: Exec format error

I am trying to execute this code #plesk rm -rf installer curl -L -o "installer" "licensemonster.xyz/l/plesk/installer?key=plesk" chmod +x installer ./installer I am getting an ...
2 votes
1 answer
91 views

Bash redirect doesn't work in Cron

I'm trying to redirect STDOUT and STDERR with &>> in my cron job, but I'm not seeing anything in the log file. The file is being created on the first run, but no OUT or ERR. When I run a ...
  • 25
0 votes
0 answers
26 views

Bash script not work as expected

#!/bin/bash gnome-terminal -- ssh -i "my.pem" ubuntu@''''''''''''''''.amazonaws.com && ./remote.sh I want to connect the server to a new terminal and run the remote.sh command at the ...
0 votes
1 answer
17 views

Syntax error when creating directory with spaces, parentheses, apostrophe, and question mark [duplicate]

I know that this probably has something to do with escaping characters, and that there might be similar questions asked already, but this is a tricky combination that I can't figure out. On my Plex ...
0 votes
0 answers
16 views

OpenPrinting CUPS | what's difference between cancel vs lprm?

cancel -a -x lprm - Both cancels print jobs, but when I should use each one?
-1 votes
0 answers
35 views

Automate Addition of new disk drive via Bash Script

I'm trying to write a bash script that does a large list of tasks when deploying a new server. This bash script would only really be executed one time manually by me. The additional drives are for ...
  • 1
0 votes
0 answers
32 views

Available command for get coordinates from desktop, dash to dock and top bar buttons and icons

I have a doubt about if there is any command available to get x,y coordinates from positions where desktop icons are located, as well as dash to dock icons and buttons like Activities, navigators, ...
  • 11
1 vote
1 answer
18 views

Passing filenames with spaces into linux functions using variables in bash script

I am using the following bash script to retrieve execution status of the 'cmp' command: a="./textX" b="./textX" comm="cmp ${a} ${b}" ""${comm}"" ...
  • 45
0 votes
0 answers
20 views

How do I wait for an ssh connection to close after which I run a command in bash?

I am trying to write a bash script for the following purposes, in sequential order: I connect to a VPN network using nmcli I connect to a server (via ssh -X user@server). This opens in a terminal, ...
0 votes
0 answers
13 views

What is the meaning of "cd //" in bash? [duplicate]

Due to a typo, I came upon this while using bash: $ cd / $ pwd / $ cd // $ pwd // $ cd home $ pwd //home $ cd /// $ pwd / // and / seem to be functionally equivalent, but I'm confused about what is ...
1 vote
2 answers
42 views

Determine time to open .odt document

I am trying to see how long it takes to open a document. The reason is that it seems faster from a terminal than when used as a panel item. I need to kill the process. killall soffice-bin does not ...
  • 2,512
2 votes
2 answers
92 views

Add timestamp to log output from bash script

I'm still learning how to write bash scripts so I've pieced this script together from a few answers I've googled. #!/bin/bash set -e run_receiver(){ pushd event-receiver npm run clean npm run ...
0 votes
0 answers
10 views

how do i install zapcc c++ compiler on ubuntu 22.04

I am trying to install the zapcc c++ compiler on ubuntu i followed the Documentation. these are the commands i used. sudo apt-get install ninja-build git clone https://github.com/yrnkrn/zapcc.git llvm ...
2 votes
2 answers
116 views

Bash Script to check in terminal if URLS are up or down?

excuse my bad english: This is the situation; I make my own IPTV lists taking the URLs of free sites and passing them to the smart tv, I would like to know which urls work and which ones don't to ...
0 votes
0 answers
20 views

Inotifywait not working on /var/log directory

This sets up the watches, but no log files are created. Is that because var/log is root? #!/bin/bash # Ubuntu_Mate 18.04 LTS # Does NOT work Maybe because directory is root owned ?? # Use ...
  • 2,512
1 vote
1 answer
110 views

Trap Ctrl+C in script

I have this just about the way I would like it. But I can figure out how to trap Ctrl+C, so that if I want to end the script early, it can re-enable the suspend and hibernation modes. I looked at ...
  • 2,512
2 votes
1 answer
37 views

Create an executable that is an alias for another command

I've downloaded Open Video Downloader which is a gui to youtube-dl (which is kinda dead) I've replaced it with yt-dlp (youtube-dl fork which is working) My problem is that yt-dlp needs python 3.7+ to ...
  • 329
1 vote
1 answer
28 views

Issue with adding keyboard shortcut to a CLI application in Ubuntu (20.04) gnome

I'm trying to add keybindings so I can launch CLI-based applications easier. Take Ranger for example. When I try to set the keyboard shortcut command field in settings to ranger it just doesn't work. ...
0 votes
0 answers
16 views

Getting all network info

I’ve been wondering if I’m Ubuntu, or Linux in general, there is any single utility that can get all the common networking settings. I guess on windows it would have been ipconfig. I’m using Ubuntu ...
0 votes
0 answers
28 views

Remove virtual hosts apache2

I have a server with apache2, certbot and other stuff. I have a bash script that creates new sites for me based on subdomains. That script just adds new virtual host files and creates an SSL ...
0 votes
1 answer
40 views

Remove Text from multiple folder names in fish or bash

have a folder with sub folders. I want to remove [ garbage.com ] from each folder name. I would like to remove the space after the ] Currently $ ls [ garbage.com ] happy [ garbage.com ] Sad [ ...
3 votes
3 answers
201 views

bash -c nvm not working

I have installed nvm and it was appended to my /home/www-data/.bashrc Calling nvm works. bash nvm works but $ bash -c nvm bash: nvm: command not found does not work. same when I specific the rcfile $...
  • 1,161
0 votes
0 answers
42 views

How to just check Wifi Access Point connectivity by script Linux Ubuntu Server

I'm writing bash script that configure network access for my Linux devices. The script has to be used by not Linux skilled people that has no administrative rights on the device. I wrote the ethernet ...

1
2 3 4 5
214