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
54 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
26 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
54 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
132 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
24 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
0 answers
24 views

How to install and run a "sh" file? [duplicate]

This is my first time using Ubuntu, i tried to run install.sh file by clicking right button and then run as program, a terminal screen popped up and closed but nothing happened. can anyone explain to ...
Hamou Ouyaba's user avatar
0 votes
0 answers
205 views

I want to upgrade Ubuntu 18 to openssh 9 and openssl 3.0

The official openssh is only up to 8.2, I want to upgrade by myself, but I can't find information on the Internet, who can guide me?
yi li's user avatar
  • 1
0 votes
1 answer
53 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
0 answers
18 views

shell scripting execution

Hi is anyone good with shell script What happens when we execute a shell script by this command by mistake ./sample.sh >sample.sh & Instead of ./sample.sh >sample.txt & I executed first ...
Max's user avatar
  • 1
0 votes
1 answer
67 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
61 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
1 vote
0 answers
585 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
390 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
2k 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="aamirpinger@yahoo.com&...
Mubashir Nazir Cloud's user avatar
1 vote
1 answer
625 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
964 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
2k 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
18 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
335 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
764 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
400 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
399 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
481 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
  • 313
5 votes
2 answers
9k 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
  • 202
0 votes
0 answers
29 views

When i run this game via ./ it tells me to change directory?

leo@leo:~/Public/Tesla Sim Linux$ ./Tesla-Sim-Linux.x86 Set current directory to /home/leo/Public/Tesla Sim Linux Found path: /home/leo/Public/Tesla Sim Linux/Tesla-Sim-Linux.x86 Mono path[0] = '/...
James Gates's user avatar
1 vote
1 answer
1k 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
7k 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
841 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
296 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
555 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 ...
imstupidpleasehelp's user avatar
0 votes
0 answers
1k 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
459 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
182 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
506 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
682 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
753 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
368 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
262 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
136 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
160 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
  • 459
0 votes
1 answer
419 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
0 votes
0 answers
256 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
2 votes
1 answer
6k 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 can't able to run the commands, I can only able to open the multiple terminals. This is written in a shell ...
Praveen's user avatar
  • 21
0 votes
0 answers
480 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
0 votes
1 answer
377 views

script file command not found

I have a simple script file first.sh as shown below: #!/bin/bash echo "hello"; a = "test"; echo "$a" when I execute it, it occurs an error as written below: ./first.sh: ...
mohsen_m's user avatar
2 votes
0 answers
10k views

sh: 0: Can't open

I am trying to run this command sh bbmap/bbduk.sh in1=fastq/Brca1Reads_ALL.1.fastq out1=fastq/Brca1Reads_ALL.1.TRIMMED.fastq ref=bbmap/resources/adapters.fa On terminal, but I keep getting: sh: 0: ...
Rizwan's user avatar
  • 21
0 votes
0 answers
127 views

there is another way to change multiple resolutions in linux without wait to the login

I have already make a script doing this and i put it in the start app applications, but these commands only start when you login, there is a another way to do it when the computer turn on, or ...
Federico Sironi's user avatar

1
2 3 4 5