The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
17 views

Alternative for notepad++'s IndentByFold plug-in in gedit (auto-indent) [duplicate]

I have some bash script which I want to beautify/code format. In my windows system i have used notepad++'s IndentByFold plug-in to code format and beautify some php,html file etc and it worked fine. ...
1
vote
3answers
75 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
37 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
65 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
43 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 ...
-1
votes
1answer
44 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
75 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
37 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
90 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
1
vote
1answer
5k 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
57 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 ...
1
vote
0answers
67 views

How to run a Shell script using Crontab [closed]

I set a cron job as a root user: * * * * * /usr/bin/sh /home/abc/Desktop/AbcFolder/pqr.sh Also, I made sure to change the rights of the file pqr.sh to CHMOD 777 Below is my pqr.sh shell script ...
2
votes
3answers
284 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 ...
0
votes
2answers
219 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 ...
1
vote
1answer
136 views

Ubuntu 14.04- 100% usage of one core [closed]

I just upgraded my Ubuntu to 14.04, and I have one small problem. One core of my i5-4670k is 100% used. There are no tasks in the background. How can I fix this?
0
votes
1answer
68 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
2
votes
1answer
222 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
156 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
74 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
1k 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 ...
0
votes
1answer
212 views

Echo to file apparently needs double escaping backslash (\\\n) to write \n. Why?

As per the graylog2 docs, I need to add this line to my rsyslog.conf: $template GRAYLOGRFC5424,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msg% \n" ...
0
votes
1answer
65 views

Need Help Improving Script

I have a group of folders (L1N-L5N), in which I want to copy from my /home/michael/documents/XXX to my Dropbox folder. At present, I have used the following script: #!/bin/sh cp -ra ...
0
votes
2answers
2k views

Installed TeamSpeak 3, won't open. 14.04

I installed Ubuntu yesterday, and I still struggle with a couple of things but I'm getting used to it. I want to install TeamSpeak 3 to talk with my friends, but I just can't make it like people do on ...
-1
votes
1answer
1k views

Can't run .sh file

Hi i am returning user of ubuntu, and i am trying to get label, and the problem how to run two files sh files in the terminal called: install-sh.sh configure.sh and i have tried to enter from the ...
0
votes
2answers
70 views

Why doesn't this second nohup command run?

Everything runs except the last line: #!/bin/bash xinput set-prop 11 "Device Accel Profile" -1 xinput set-prop 11 "Device Accel Velocity Scaling" 1 xinput set-prop 11 "Device Accel Constant ...
0
votes
1answer
102 views

Use alias inside a script

One of the software tools I'm using requires "sh" to be a symlink to "bash" instead of "dash". Since I don't want to change the default shell to bash for the whole system and I can't change the tool ...
2
votes
1answer
62 views

Why does the “watch” command starts two “watch” and a “sh” process?

When I tried to run watch ps command I got the following result: Every 2.0s: ps Thu Jul 31 14:06:45 2014 PID TTY TIME CMD 4329 pts/1 00:00:00 ...
2
votes
1answer
206 views

How to compile a SH file so it can be uploaded to PPA Launchpad

I want to make a few installation scripts via .SH files, and then upload them to http://launchpad.net? How would I do that?
1
vote
2answers
556 views

sh: 2: source: not found

I am having a problem with the installation of Armitage in Ubuntu 14.04 I have followed this link and everything is Okey http://www.darkoperator.com/installing-metasploit-in-ubunt/ But the last ...
0
votes
0answers
492 views

How to launch sh file without terminal? [duplicate]

Using Ubuntu 14.10 the sh file will only open in a text editor but not opening the game Xonotic and AssaultCube
5
votes
2answers
2k views

sh: echo: I/O error on pm-suspend Ubuntu 14.04

I just installed Ubuntu 14.04 on my Fujitsu Lifebook U772 after a long hiatus with Opensuse and after the install, it appears that pm-suspend works out of the box. A few days of setting up later, ...
0
votes
1answer
62 views

Subshell in script wont print corectly

Why does my shell and subshell only print the first hour in my for loop? It's supposed to loop through all 24 hours in a day but only prints the first hour correctly. { for D in $(seq -f "%02g" 1 ...
1
vote
1answer
2k views

Good shell script to move a file to another location?

I'm trying to write a shell scrip to move a file to a a different location when it's found. And when it's not found to move a file from that different location to its location. This is basically my ...
0
votes
3answers
856 views

Permission denied error while creating file by using script file

I have created a script file called black_list.sh. #!/bin/bash default_card=`head -1 /proc/asound/modules` echo $default_card if [ ! -e /etc/modprobe.d/sound.blacklist.conf ] && [[ ...
0
votes
1answer
188 views

How to launch .sh from third party program?

I have the program Lutris installed on my computer and I am going through adding all my linux games. However some are .sh execs others are .bins and executables which both added fine. the .sh ones are ...
0
votes
1answer
79 views

Trying to install Netbeans 7.4

When trying to install netbeans-7.4-linux.sh, I cannot open my personal folder where the file is located. I try cd /home/myusername/downloads, but I get: File or folder does not exist. If I try to ...
-2
votes
1answer
164 views

How to make a shell script pipe aware

I have the following script: #!/bin/sh [ "${#}" -eq "0" ] && (printf "%s\\n" "${0}: word ..." >&2; exit 1) _whats() { [ -z "${1}" ] && return 1 [ -z "${2}" ] ...
14
votes
2answers
972 views

What is the difference between grep apple file and grep “apple” file?

What is the difference between grep apple file and grep "apple" file? What does putting the quotation marks do? They both appear to work and do the exact same thing (display same line).
57
votes
3answers
121k views

What is difference between #!/bin/sh and #!/bin/bash?

if I write, #!/bin/bash echo "foo" or #!/bin/sh echo "foo" both yields same. I have seen some scripts starting with #!/bin/sh or #!/bin/bash. Is there any difference between them?