Skip to main content

Questions tagged [sh]

/bin/sh is the POSIX shell. For questions where portability is important. If the question is about .sh files, tag it with `scripts` instead. On Ubuntu the POSIX shell is symlink to `/bin/dash`, and [dash-shell] is therefore related to [sh] tag, and both may be used when tagging questions.

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

ASUS ROG Strix GL664 I7 13650HX 16GB

Pls let me know which Ubuntu version I could install on my Asus laptop?!!!!! Ubuntu 20.04 LTS couldn't detect my SSD . Ubuntu 24.04 LTS , stop install process with bellow unknown error!!! ...
Shahla Hasanzadeh's user avatar
0 votes
1 answer
71 views

Why does shell script (.sh) give different results than command line for running Flask service with sudo?

I have a sequence of commands that I run from the command line. Here are the commands and output when run from the command line: ~/bettermult $ sudo systemctl stop bettermult + sudo systemctl stop ...
M Katz's user avatar
  • 111
4 votes
1 answer
4k views

How to solve the response of my terminal that works very slow and badly? [duplicate]

The problem is that my terminals not work great anymore. The typing is very bad in terminal and each command response not if I press a key. Sometimes the command runs but it ends not, but when I hit ...
Cl4udi4's user avatar
  • 51
0 votes
0 answers
157 views

How to install .sh file of timedoctor?

I try to install timedoctor time tracker from https://2.timedoctor.com/activate?authorized= on my kubuntu 22.04 But I downloaded timedoctor2-setup-3.12.77-linux-x86_64.run file in 129 Mib and script ...
mstdmstd's user avatar
  • 125
1 vote
1 answer
147 views

Scrolling gnome-terminal output programmatically?

Is there some way to automatically scroll to the beginning of the terminal output from sh script? I have custom build routine in my development process: sh script is using inotifywait to detect source ...
Yuri Gor's user avatar
  • 173
1 vote
0 answers
136 views

NVM not start downloading, fails download after sometimes

recently i have installed Ubuntu 20.04.6 LTS x86_64 when i hit the command curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash it does not start downloading, it just ...
kryptonian's user avatar
0 votes
0 answers
165 views

Fish shell "fish_prompt.fish" error

_tide_remove_unusable_items: command not found ~/.config/fish/functions/fish_prompt.fish (line 5): _tide_remove_unusable_items ^~~~~~~~~~~~~~~~~~~~~~~~~~^ from sourcing file ~/.config/fish/functions/...
S1mPl3's user avatar
  • 1
0 votes
0 answers
92 views

Automatically input text ( sript ) when the terminal open

I have script to mute sound: pactl set-sink-mute 0 true Tt's working if I run directly in terminal but if I make file.sh or run in crontab: * * * * * pactl set-sink-mute 0 true I get error. Is there ...
adrian's user avatar
  • 27
1 vote
1 answer
46 views

Difference between executing .sh/.bash program with sh/bash and executing it directly [duplicate]

If we have a program start.sh, we can execute it with the sh start.sh. But we could execute it giving permission with chmod and run ./start.sh in the command line. What is the difference between those ...
Vitor_figm's user avatar
0 votes
1 answer
126 views

Desktop shortcut from a .sh with a delay

I want to have a desktop shortcut for TWO apps in .sh format with a 15 seconds' delay between them during the launch. Is it possible? What kind of script I have to do for that? If anyone can give me ...
Pinedours's user avatar
0 votes
1 answer
460 views

Anydesk installation by bash script using wget

I'm trying to write a bash script for automating the installation of anydesk by wget with the help of th following code: echo -e "[ - ] Installing AnyDesk..." wget --max-redirect 1 --trust-...
Muhammad Habib's user avatar
0 votes
0 answers
79 views

Two terminal windows open up when I start my Ubuntu app with GNOME

I have created a simple terminal application and want to use a simple desktop icon in Ubuntu with GNOME. Currently I have created a .desktop file with the following content: [Desktop Entry] Encoding=...
Marcus Cvjeticanin's user avatar
0 votes
1 answer
102 views

Creating a folder from QML with /bin/sh -c mkdir

Hi I'm trying to create a folder from QML with a QProcess call: qproc.start("/bin/sh -c 'mkdir -p /tmp/x'"); It doesn't do anything. Nor does it return any error. From what I read, this ...
lvr123's user avatar
  • 89
0 votes
1 answer
266 views

How to Automatically run/stop a script at a certain time of the day

What I want to achieve: 8:00 AM: Runs a sh script (this script does not stop running until the user presses ctrl+c) 8:00 PM: stops the script by sending ctrl+c or other means Repeat I tried ...
Tupopo's user avatar
  • 39
0 votes
0 answers
19 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 ...
RRR CCC's user avatar
  • 113
0 votes
1 answer
140 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 [ ...
Michael Mantion's user avatar
2 votes
0 answers
807 views

Executable-text-files Option missing on Ubuntu 22.04 LTS / GNOME 42.0

SH files should be executed when double-clicking, instead of being opened in a Text Editor, e.g. Gedit. One can assumingly change this behavior through option "Executable Text Files" in ...
JoyfulPanda's user avatar
-1 votes
1 answer
692 views

Syntax errors ubuntu 22.04

every time i update my system using the sudo apt update command in the terminal i notice this at the bottom. sh: 1: Syntax error: "(" unexpected sh: 1: Syntax error: "(" ...
Steven Mwamba's user avatar
0 votes
1 answer
3k views

executor failed running [/bin/sh -c apk add --update nodejs nodejs-npm]: exit code: 1

Please help me out to fix this error while building a docker image using this command, docker build -t my-first-app . My Dockerfile content is FROM alpine LABEL maintainer="[email protected]&...
Mubashir Nazir Cloud's user avatar
1 vote
1 answer
944 views

How to insert a block of code inside a file based on specific pattern in Linux

I want to insert a block of code inside a file name build.gradle This is the block of line: signingConfigs { release { storeFile file("$keystorefile") ...
White Mask Guy's user avatar
0 votes
2 answers
2k views

How to launch multiple Gnome-terminal windows in a shell script and continue only after these have finished

In a script, I want to launch a number of Gnome Terminal windows, and then proceed with the script only when the windows are closed. I have a shell script containing: command 1 gnome-terminal ./...
Khalil Charbi's user avatar
1 vote
1 answer
8k views

Bad substitution

I am writting a shell script which will monitor the folder "/home/Folder" and it will call the script.py when it found the file format 1234567.csv file. inotifywait -m --format '%f' -e ...
Susan's user avatar
  • 113
0 votes
0 answers
19 views

Continue sh script after accessing root [duplicate]

I execute a sh script in terminal which backs up some folders. However, these folders are contained within the /var/www/ directory. I use sudo -i to access this directory but when it's executed in the ...
jim's user avatar
  • 1
0 votes
1 answer
565 views

Cannot run bash script

I tried to make a bash script to open a file in VS code but it is giving the error: Bash: ./open.sh: Permission denied This is the script: #!/usr/bin/bash code $1
Manav Ghai's user avatar
6 votes
1 answer
1k views

my ubuntu shows shell script echo in strange way

Hi I have a file with shell script which looks like this #!/bin/bash todayDate=$(date) echo "Today's date is ${todayDate}. have a nice weekend!" but when I call this file in my ubuntu ...
game lover's user avatar
3 votes
1 answer
2k views

Unable to install a .sh file

I am trying to use a package called mgl-tools and when I run ./install.sh, it isn't working. It used to work a few days ago. The error: ./install.sh Installing MGLTools to /home/aka/Desktop/Expt 10/...
AKA's user avatar
  • 55
2 votes
0 answers
631 views

How to merge multiple video files with different codecs? MP4/H.265

I have a very very very ugly script to merge multiple files of my football games (I have 10 cameras a game) and now I am starting to make highlights of each game. But some of the cameras have ...
Jamie Hutber's user avatar
0 votes
0 answers
528 views

About installing .sh Ubuntu 20.04

I'm trying to install this file .sh https://github.com/greatfire/website-mirror-by-proxy/tree/master/install I used these command line chmod +x install.sh sudo ./install.sh after that it show me ...
Dr Brok's user avatar
  • 11
0 votes
1 answer
773 views

How to create calculator with bash?

How to create calculator with bash ? example read -p "calculator count: " calc echo '$((calc))' | bc i input 2+2 output (standard_in) 1: illegal character: $ how to fix ? I just ...
Joe Cola's user avatar
  • 343
6 votes
2 answers
12k views

Script to run a command in a terminal and then open a new terminal tab and run another command

I am running Ubuntu 21.04 and I want to create a script, that would do the following: Run: cd && cd path/to/repo && git pull && npm i && code . && npm run dev ...
Mike K.'s user avatar
  • 254
0 votes
1 answer
3k views

How to make shortcut for .sh file?

I have a file called RunRoR.sh i have enabled it to be executed and run as a software but when i double click it it doesn't do anything so in order to run it i have to do ~$ sh RunRoR.sh Can i create ...
James Gates's user avatar
1 vote
1 answer
10k views

bin/sh: 1: source: not found

I am trying to install fpylll from a repository on Ubuntu 18.04 The fpylll instruction in README.rst says that after Automatic install you should do $ source ./activate but I get a notification: / ...
Dew Debra's user avatar
3 votes
2 answers
929 views

Shell script keeps executing even if was true

I have a simple shell script to check if the user exist, if not, add that user #!/usr/bin/bash echo "Enter user" read -r user if [ "$(id -u "$user" &>/dev/null)" = ...
Lê Quốc Khánh's user avatar
0 votes
1 answer
636 views

Can't access my VPS through SSH

I just misconfigured my /etc/passwd had used this command on root login root@ubuntu:~# sh -c 'echo "nope no entry mates" > /etc/passwd' Now whenever I try to access my VPS though any ...
tommy_shelby's user avatar
0 votes
0 answers
34 views

Shell script that runs python script again when it's finished [duplicate]

I want to create a sh script that runs python script python core.py and when the script is finished pause for some milliseconds and run it again. And so on and on. Not sure where to start - any help ...
John T's user avatar
  • 101
0 votes
2 answers
1k views

Running .sh file with one button click

I am a linux beginner and I am trying to automate a small task on my computer. In order to connect to my vpn, I have to open my terminal and type nordvpn connect I have created a simple .sh script ...
Dylan Bozarth's user avatar
0 votes
0 answers
2k views

-bash: sh: command not found

I wanted to switch the shell to sh so I typed: rakinar2@hotspot:~$ sh But it says: -bash: sh: command not found How do I fix that? Note: test -e /bin/sh returns 1! EDIT: ls -l /bin/{,ba,da}sh ...
Ar Rakin's user avatar
  • 101
1 vote
0 answers
551 views

GNU make executes weird shell

The shell function in GNU make behaves weird on Ubuntu. Consider this simple Makefile: TEST1 := $(shell command -v sh) TEST2 := $(shell /bin/sh -c 'command -v sh') all: $(info TEST1 = $(TEST1))...
Jakub Klinkovský's user avatar
1 vote
0 answers
268 views

Ubuntu live: ubiquity.desktop (alias "Install <MyDistro>") is not launched

I have created a custom distro using Cubic which comes from Ubuntu 20.04.2 LTS Desktop 64-bit. I have noticed that if I open the file manager as root and then double click on the file then it works. I ...
Mario Palumbo's user avatar
1 vote
1 answer
777 views

easiest way to delete backslash from file name

I have a list of files similar to the following and I need to delete the backslash: \jskadn.txt \jsandkjasn5.txt I tried running the following command, but it doesn't work : rename " \\*.txt&...
PythonUser's user avatar
-2 votes
1 answer
942 views

How to write a shell script for printing the PID and The owner and the Name of the Process using the Special Variable $$ as parameter for the skript

The script shall present the command pstree -hsup $$. I have tried many different ways but I couldn't find a way to print the output like this 28348 (bash,root) 28347 (su,root) 28346 (sudo,root) 14085 ...
Flowless Man's user avatar
0 votes
3 answers
984 views

merging tab delimited txt files based on column (which is header ) in bash?

Im having two text files which contains million records , all the records are tab delimited , how we can merge these two files based on same header(column)? file:1 LogEntryTime nameId ...
Vamshi Krishna CH's user avatar
3 votes
2 answers
484 views

Lubuntu 20.04 cannot execute .sh script from PCManFM-Qt

Lubuntu 20.04. I've created a simple .sh script to run my Java program, so content of .sh is: java -jar /path_to_my/test.jar I marked this script as executable, and when double-clicking on it in the ...
asph galax's user avatar
0 votes
0 answers
306 views

How to fix "set -e -o pipefail" (CentOS script) for Ubuntu 18.04 LTS?

I'm working with a set of scripts that automate some bioinformatics (mitoVGP; https://github.com/VGP/vgp-assembly/tree/master/mitoVGP) and then the install is done as a conda environment. The problem (...
Andor Kiss's user avatar
0 votes
2 answers
166 views

Is Bash a language or a program? [closed]

I've seen it listed as a scripting language and other sources state that its just a program that runs predefined scripts in the bin whatever folder. So my question is are the bash commands on every ...
ADX zerytech's user avatar
1 vote
1 answer
290 views

How can I do command substitution in a .desktop file?

Can I do bash-like command substitution in a .desktop launcher? For example, something analogous to this: Exec=/some/prog --arg "$(zenity --entry)" By that I mean "run this command and ...
geekley's user avatar
  • 579
0 votes
1 answer
551 views

Run command one after the other from bash script

I'm trying to run some commands one after the other, but I think I'm making some mistake since only the first command is being run. I have a bash script that is like: #!/bin/bash sudo su && ...
Andrea 's user avatar
1 vote
0 answers
329 views

Why does $BASH_VERSION works and don't work depending on how I echo it?

I am in a sh terminal. When I do this echo $BASH_VERSION I get the version printed. However when I do this echo "`$SHELL -c 'echo $BASH_VERSION'`" I got nothing. I am not an expert on ...
KansaiRobot's user avatar
3 votes
1 answer
7k views

How to run multiple commands in multiple terminals using single shell script command

I have tried to write a shell script to run multiple commands in multiple terminals, but I am not able to run the commands. I can only open multiple terminals. This is written in a shell script file ...
Praveen's user avatar
  • 31
0 votes
0 answers
595 views

Ubuntu20: nothing happens when I try to run Anaconda install script

I have downloaded the current version of Anaconda to my Downloads folder. In Terminal I CD’d to the folder and tried bash Anaconda3-2020.07-Linux-x86_64.sh Nothing happens except that a fresh prompt ...
John R. Woodward's user avatar

1
2 3 4 5