/bin/sh is the POSIX shell. For questions where portability is important. If the question is about .sh files, tag it with `scripts` instead.

learn more… | top users | synonyms

1
vote
1answer
12 views

Matlab related Sh file command not found

I'm trying to launch a program (ExploreDTI) which uses Matlab Runtime R2014a (8.3). I have a MainExploreDTI file (Executable (application/x-executable)) and a run_MainExploreDTI.sh sh-file. In ...
0
votes
0answers
21 views

script not executed on start

I've created a script like this #!/bin/sh # /etc/init.d/xcode: change keyboard xmodmap -e "keycode 74 = backslash bar" I put it inside /etc/init.d I set executable option for all user I create a ...
0
votes
1answer
45 views

Can't execute script in terminal

I am a total n00b I am trying to install Ubuntu on my phone and I am stuck. I can't execute a script in the terminal. This is the path: sdcard/Ubuntu/Ubuntu/Ubuntu.sh Result: Can't execute: ...
0
votes
0answers
15 views

Why libuuid and apt-mirror have shell?

Checking my /etc/passwd file, I noticed this: libuuid:x:100:101::/var/lib/libuuid:/bin/sh apt-mirror:x:122:134::/var/spool/apt-mirror:/bin/sh Why these system users need shell? Would it be safe ...
2
votes
2answers
47 views

Is it possbile to uninstall sh?

This may sound silly but I want to uninstall sh (for research purposes) and replace it with my own shell. Is this actually possible? Many scripts and programs seem to have it hardcoded in, so I'm in ...
2
votes
2answers
2k views

How to run my C programs with the Bourne Shell?

I have no problem running my C programs by switching to their directory and starting them with ./. However, I'm not sure why changing to the directory and then typing sh [Program Name] gives me this ...
1
vote
1answer
47 views

How to change the default shell of at command

when I want to delay the execution of a program using at, it precise me that warning: commands will be executed using /bin/sh How the change this default shell, to bash for instance ?
0
votes
1answer
82 views

Installing tar.xz game (libGLU.so) [closed]

Unpacked the game, running sh start.sh results in: start.sh: 2: cd: can't cd to start.sh ./hoi4: error while loading shared libraries: libGLU.so.1: cannot open shared object file: No such file or ...
0
votes
1answer
58 views

Installing Mathematica on Ubuntu 15.10

How do I install using a .sh file on Ubuntu 15.10, I'm specifically trying to install Mathematica. The file I'm wanting to use is Mathematica_10.4.1.sh
0
votes
0answers
9 views

Save time command in a text file [duplicate]

I'm trying to do a script to get the Gera (.class file) output in a range and get the time of system resource usage. My sh file: for i in $(seq 16 20) do echo "$i" time java Gera $i done ...
1
vote
1answer
151 views

Running a bash script from an xsession to toggle startup programs

So I've got an interesting challenge in front of me, running Ubuntu 16.04. I originally created a .xsession file that ran Exec=google-chrome --kiosk http://some-url.com to boot as a kiosk device. ...
0
votes
1answer
46 views

Running .sh file right after login and root login

How can I automatically run a .sh file right after I login with my regular credentials, and my root password. Thanks
-1
votes
1answer
43 views

Executing shell script

I have a script: echo "start" cd ~/GoogleDrive/ drive push path-to-file/ echo "done" which uploads path-to file to my Google Drive account. I can run this script without any problem by sh ...
-1
votes
1answer
40 views

Some programs print errors to stdout instead of stderr, and don't set $? when an error occurs. Why? [closed]

See title. I've seen this twice recently, with both udisks and pacmd, and they are 100 times harder to script because of it. Why do programmers do this? For example, I want to switch the audio output ...
0
votes
3answers
56 views

string “if” statement comparing is string empty

I have problem checking if string is empty. I get first column of ls -l info and try to grep string searching for "x". If string is empty, I should countinue. But whenver string is empty or not, I ...
0
votes
2answers
95 views

Check if input string exists in file

You must read string1, what should I do? Here's my code: #!/bin/sh echo "Enter your sting: " read read string1 if [ grep -q $string1 file.txt ];then echo "Found it" else echo "Sorry this string ...
0
votes
2answers
92 views

Problem installing .sh file

I have this file Mathematica_10.0.0_LINUX.sh that I need to install in my Ubuntu 12.04 LTS. I have already, successfully, run chmod +x Mathematica_10.0.0_LINUX.sh. However, when I run sudo ./...
0
votes
1answer
90 views

Get wireless access points name or ssid which do not prompt for password using shell script in ubuntu

I just want to get wireless access points name or ssid list which do not prompt to enter password using shell script in ubuntu. Or I can say that I want to get ssid or wireless access point name list ...
1
vote
1answer
33 views

LiveCD: Running a sh script on startup

I have created sh script that backs up computers to a network location, and I'm trying to make a LiveCD of Ubuntu-Mini Remix 14.04 that will be able to launch the script without a GUI. The script does ...
-1
votes
2answers
136 views

Getting error while starting ubuntu 14.04

Every time I start my system I received this message: Error found when loading /etc/profile: /etc/profile: line 1: syntax error near unexpected token (' /etc/profile: line 1:iamgreat# /etc/profile: ...
2
votes
1answer
44 views

Why to use bash in executing script? [duplicate]

In a former question, I was suggested to execute: sudo bash start-dfs.sh why not sudo start-dfs.sh ? I mean, what difference does bash makes?
1
vote
1answer
84 views

.sh to run terminal command

This is probably insanely simple but I'm sort of new to this and have no idea what I'm doing. Very simply, I have MouseON.sh that when ran, I want it to open a terminal, run a command, then close the ...
1
vote
3answers
542 views

sh: all commands “not found”

I was updating my PATH variable in .bash_profiles and /etc/environment and I rebooted the system (Ubuntu 14.04). After login, I got these errors: -sh: 1: id: not found -sh: 12: [: Illegal number: ...
0
votes
0answers
12 views

Why nano file work's and echo “” >> file not? [duplicate]

I'm doing a shell script where I need to write a file. I'm using echo, as below: sudo echo "text text text" >> file I can not use because I'm not allowed. permission denied But using ...
-1
votes
1answer
36 views

Why am I able to execute a file which has just read permission? [duplicate]

I am able to execute a file which has just read permission: nkrish@maddev2:~$ ls -l NewFile.sh -r--r--r-- 1 nkrish nkrish 14 2016-01-14 12:01 NewFile.sh sh NewFile.sh .. File gets run... ...
1
vote
0answers
18 views

How to make a .desktop file show its progress in terminal? [duplicate]

I have a .desktop file set to 100% upgrade my system when I double click it, and I would like to see the results of what is happening when I click it. It is basically running a shell @ /home/david/...
0
votes
1answer
99 views

Script to empty trash [duplicate]

I've created a script to empty my trash. I want to be able to execute it without having to use the terminal. Is there anyway I could do this?
2
votes
1answer
70 views

Create folder loop function doesn't work

I have created a function in a .sh file that creates directories in a loop with 3 parameters int: start, end and folder name name But I am getting the following error: Syntax error: "(" unexpected ...
0
votes
1answer
870 views

I cannot open .sh file in ubuntu 15.04 [duplicate]

I right click and into properties I allow the permision to run as a programe. But still cannot run it. It is still opening in text document file
0
votes
1answer
37 views

Code browsing for scripts

We have cscope and ctags for .c and .h files. Are there any code browsing tools for shell scripts (.sh)?
0
votes
3answers
3k views

Can't run shellscript with sudo

When I try to run my script like this: sudo ./connector.sh It give me this: sudo: ./connector.sh: command not found What am I doing wrong?
2
votes
1answer
14k views

Permission denied when running sh file

I am trying to use an sh file to easily start a screen with my minecraft server console. I named this file mc.sh. I have another sh file in the same directory as mc.sh that runs fine. Here is what is ...
1
vote
3answers
277 views

Bash shell for loop process with two paired variable names

It's common to use bash shell for example to bulk rename plenty files. Usually I used the following structure, for file in ./*.short do # do command done That's for filename with .short extension. ...
1
vote
1answer
163 views

How to update the multiple files without changing file date?

I have replaced word 'merchant' to 'capital' in files founded in the current directory using following command: find * -type f -exec sed -i -e 's/merchant/capital/g' {} \; but above command will ...
1
vote
1answer
497 views

script sh syntax error [closed]

I have this script: #!/bin/bash IP='192.168.1.1' fping -c1 -t300 $IP 2>/dev/null 1>/dev/null if [ "$?" = 0 ] then echo "Host found" else echo "Host not found" fi When I try to run it, ...
0
votes
1answer
463 views

How do I export a variable to the `sh` shell? [duplicate]

Calling export MYVAR=/path/to/whatever from .bashrc obviously works for bash but not for the sh shell. Unfortunately, the Matlab launcher seems hell-bent on using sh and not bash. As such, the ...
0
votes
1answer
99 views

What will be effect of removing sh file in Ubuntu?

i have removed my sh file by mistake. I want to know is it impact on executing a application program? or is it fine? If it effects, then what will be the ways to recover it?
0
votes
1answer
278 views

Open up new terminal and run script with double click in Unity

I want to execute expect -c " spawn ssh user@10.0.0.0 expect \"assword:\" send \"pass\r\" interact " in a new terminal by doing double click in an .sh script. I tried #!/bin/...
0
votes
1answer
52 views

What is the difference between sh and ./ [duplicate]

When given a binary in a terminal, you can launch it via sh myapp or ./myapp Are there any other ways to launch the app? Is there any difference between sh and ./ ? What do they denote/stand for?...
0
votes
1answer
236 views

g++ command not found in sh script

I don't know, maybe this is a duplicate, but I didn't find any help. So, the problem. I have a simple problem - I made a script to automate C++ compiling a bit. Well, there's the script. #!/bin/bash ...
0
votes
1answer
500 views

How to accept root password through shell script [closed]

Is there any way that I can provide root password in the shell script without explicitly entering it through the terminal
3
votes
2answers
59k views

How to install Netbeans 8.0.2 on ubuntu 14.x

I have netbeans downloaded from the netbeans.org site. This is the file name → netbeans-8.0.2-linux.sh I dont know how to install it on ubuntu 14.10 Is there any one can help me install netbeans on ...
0
votes
1answer
269 views

Cross fading several audio files using sox

I'm trying to cross-fade several audio files together with a 3 second cross-fade and join them together in to one file with sox. I can join several files together by the command below but not sure ...
2
votes
3answers
502 views

Why do I have to change into my private bin folder to execute an .sh script?

I have a private bin folder in my home directory. It's is also in my path. If I try to run a script from anywhere else in my system but within that folder, I get sh: 0: Can't open [name of script]....
0
votes
2answers
344 views

Help Starting Minecraft Server Ubuntu 14.04

My .sh file to launch the server is not working. I have the file named 'craftbukkit.sh' with this pasted in it (from the bukkit set up wiki) #!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "$...
0
votes
1answer
81 views

Start program after login in Ubuntu

I try to run Jira after Ubuntu start. In /etc/rc.local I wrote this: cd atlassian/jira/bin; ./start-jira.sh (all directories wrote properly) Where is my mistake? Full rc.local: gists
1
vote
1answer
369 views

Cant read variable from user input in bash

I try to run script of my friend and I get this error when try to input some variable: : bad variable nameead: reload : not foundsh: 10: bin/reload.sh: bin/reload.sh: 11: bin/reload.sh: Syntax ...
0
votes
1answer
362 views

Make all new .sh file executable

One of my script is making new .sh files in /tmp/ folder how can I setup that all new files in /tmp/ folder will get chmod -x automaticaly because my script is failing when trying to run scripts in /...
-1
votes
3answers
93 views

Create a script that takes a word as an argument from the user

echo "Enter your string" read str; How can I put in a check to make sure the user passed in a word, displaying a usage statement if a word was not passed as an argument.
1
vote
4answers
5k views

How Can I Run an Shell Script With .desktop Config File?

I am trying to run a shell script with a .desktop file but it doesn't seem to work, producing an error of There was an error launching the application at each attempt. I have the sh and .desktop files ...