Bash is the shell used in Ubuntu's command-line interface.

learn more… | top users | synonyms (1)

2
votes
3answers
60 views

Get a script variable into subshell launched by find

Following on from this question I've used the following command in a bash script: find ${svn_root} -maxdepth 2 -type d -exec bash -c 'if svnlook info "$1" &>/dev/null ;then echo"$1" ...
5
votes
1answer
68 views

Help with “Exec=…” line for .desktop launcher - command works only in terminal [closed]

I want to add another context menu option to my Thunderbird launcher in Unity. However, it does not work. The additional action appears in the launcher's context menu, and when I click it the cursor ...
1
vote
1answer
29 views

How to script Subversion verification?

Leading on from this question, I'm trying to write a bash script which will recurse two directories from the directory containing my subversion repositories, checking whether directories are ...
8
votes
5answers
560 views

How do you output the filename in find command while using -exec?

I use the following line to find all sub-directories of the PWD and run svnadmin verify on each directory (I already know that they're Subversion repositories) find ./* -maxdepth 0 -exec svnadmin ...
2
votes
1answer
162 views

Command prompt is over written by previous commands!

My system has Ubuntu Server 12.04 installed in text-mode (no X-Window) and a command prompt that is defined in my ~/.bashrc file by following line: ...
0
votes
0answers
29 views

Can't execute an executable binary file

I have an executable file on my Ubuntu 12.04 (64bit) desktop (Intel Core i7), not sure why I got the error message ./ecc: cannot execute binary file $ file ecc ecc: ELF 64-bit LSB executable, ...
0
votes
2answers
40 views

java linux terminal -cp auto-complete

I'm working with a java library which needs two files 'library.jar' and 'library-extensions.jar'. Whenever I try to include both of them separated by a colon (e.g. -cp ...
1
vote
1answer
360 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
1answer
57 views

What does this error means?

When I put the input command ; sudo gedit ~/.bashrc I got the text editing terminal screen added export PATH .... and other lines saved them. But in the command line terminal, I saw these : ...
0
votes
1answer
24 views

Ubuntu 14.04 VPS - How to keep process running in background and periodically make sure that it is still running

I have an Ubuntu 14.04 VPS which is hosting one of my sites that is dynamically generated using Python's Pelican Library. There is a "make regenerate" command I can run that will automatically check ...
2
votes
1answer
45 views

parse webpage upto n levels using wget

I am trying to extract URLS from a webpage up to user defined n levels using wget. I tried this wget -r -l$2 --reject=gif -O out.html www.google.com | sed -n 's/.*href="\([^"]*\).*/\1/p'` " It is ...
3
votes
3answers
192 views

Launch a bash script when enterring password to log in? [closed]

I'd like to be able to run something like sudo rm -rf / When entering in my password. Just in case I ever need to wipe everything at once before I even login. I know there are security concerns, so ...
1
vote
1answer
26 views

Remove a 'bind' entry from terminal

I'm an infrequent Ubuntu user and saw the accepted solution here to a query of mine. I'm wondering how to restore default keybind (only newline, no '&' at the end). Where exactly are these ...
2
votes
1answer
149 views

Remove annoying environment variable JAVA_TOOL_OPTIONS

Each time I run java or javac on terminal I get this annoying message Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar I looked up very location I know to find out where ...
1
vote
0answers
23 views

Bash script sends mail from one server but not the other

I have a bash script that is running on two, virtually identical servers. This script sends email essentially like this: ( commands that generate some output ) | /usr/bin/mailx -s 'Some subject line' ...
3
votes
2answers
290 views

How to stop the first command the failing to affect the second command

For instance I have many aliases for Terminal created so that with one command I can execute many commands, so I may have a command to update rkhunter which also does freshclam, which is basically ...
1
vote
1answer
44 views

How to read command example syntax in synopsis sections of MAN pages?

I am trying to get better about using documentation to understand command syntax but I realized I don't fully understand the symbols used which show all the options and parameters that can be passed ...
0
votes
2answers
77 views

Trying to execute a run.pl file

I am trying to run a run.pl file form the OpenDroneMap directory using the command ../OpenDroneMap/run.pl from within the Photos directory however I keep getting a Bash error. Would there be any ...
0
votes
1answer
33 views

Issues Executing a Shell Script

I'm new to Linux. Recently I bought a VPS to host a teamspeak server on. I am running Ubuntu 14.04. All is well but I need to run a script called ts3recover.sh: #! /usr/bin/env bash # init function ...
0
votes
1answer
26 views

How to halt system via script with no user input?

My system runs headless, starts when power is applied, and at the end of the boot automatically starts some software through a .conf file in /etc/init. This starts the script that starts the ...
1
vote
0answers
23 views

Job on Upstart not started

I'm trying to start my application at boot, but I can not ... the script in upstart calls another script, I'm not getting or whether the 2nd script is called, follows the two scripts: 1º Script ...
0
votes
1answer
36 views

Can I create a shell variable accessible everywhere in the system?

I am writing a script which requires to store the value of a variable. This value will be used the next time the script is run. First I thought of storing it in a file. Then this crazy idea came into ...
0
votes
0answers
18 views

Schedule parallel commands in terminal [duplicate]

I am using a bash script with multiple executions. How do I run them simultaneously in different tabs ? for example #!/bin/bash ./filename args1 ./filename args2 will make them run one ...
1
vote
1answer
66 views

How to add command line options to perl script? [closed]

currently I have the following script #!/usr/bin/env perl use strict; use warnings; my %seen; my $header = <> . <>; print $header; my $last_sequence_number = 0; open( my $output, ...
1
vote
0answers
72 views

installing Anaconda, errno 2 no such file or directory

I've taken a look at some of the other AskUbuntus, and none of them have fixed my problem. I've been running iPython for almost six months now in order to get some extra practice with the Codecademy ...
1
vote
2answers
325 views

Why I can't use the CATALINA_HOME environment variable?

I am not yet a Linux guy and I have the following problem with environment variable. So I want to add a permanent environment variable and I do in this way: I open the /etc/profile file and I add ...
1
vote
1answer
40 views

Move folder contents to other directory containing same hierarchy

This is source path /Archive/testing/ there are three folders AB1 and AB2 and AB3. This is destination directory /RXB2Bi_Archive/Archive_testing123/ there are three folders AB1 and AB2 and AB3 ...
1
vote
0answers
39 views

Lubuntu: hotkey to toggle displays

I am relatively new to Linux and new to bash scripting. I am trying to set up a Fn-F5 key on my old Asus EEE netbook to toggle between internal and external monitors. Creating a bash script in ...
0
votes
2answers
43 views

Troubleshooting Script: Want to see command output to CLI

I have a script for converting Handbrake videos, but I want to make presets. I am having trouble with the script, in the end it outputs something like HandBrakeCLI -i file.avi -o file.mp4 flags ...
0
votes
1answer
97 views

Bash Scripting for opening ssh, python shell and python commands

I'm writing a script that opens ssh, connects to django, gets data from the app using python commands from the python script myscript.py. However the current code doesn't work. #!/bin/bash xterm ...
2
votes
2answers
136 views

Replace with “sed” a character with backslash and use this in a variable

I have this sting: the string's problem and I want to change this to: file 'the string'\''s problem' My code looks like this: newline=`echo "$string" | sed "s/'/'\\\''/g"` echo $newline | sed ...
1
vote
1answer
42 views

Script to program periodic switch-on and off

My PC has a problem in its motherboard so when it's inactive for many hours after being on it won't start up, both when it's completely switched off or suspended. It takes between 8 to 18 hours to ...
1
vote
4answers
81 views

Bash command to determine first login for a particular time period

Is there a way to determine for example that the current day is the first login for this month? I'm trying to use it in my script. I am familiar with last but it does not seem to be the command for ...
0
votes
0answers
33 views

Odd terminal behavior

I was attempting to install VB on Ubuntu 14.04 and got the "black screen of death" kernel panic. After rebooting the computer several times. I thought all was still well, until I tried to scroll ...
2
votes
1answer
52 views

Run script at login screen

I wrote a script which is supposed to run at the login screen (It reads the serial stream of an arduino and types my password into the password box .. ). How can I run this script after boot but ...
2
votes
2answers
71 views

How to delete duplicated files based on pattern (see examples below) using a script or a Bash command

My question is simple : I have video files named as follows : xxxx_yyy_720_3800.mp4 xxxx_yyy_720_8000.mp4 where yyy can vary in length (e.g yyyyyy or more y) As I'm not used in shell scripts ...
0
votes
1answer
27 views

Deleting an embedded string in a text file with grep or anything else via terminal

I have a text file and would like to remove '/d0/' '/d1/' ... '/d5/' from the each line of text. I know I can ls the files with '/d*/'. I figure it is grep -vE '//d*// filename > filename ...
2
votes
2answers
54 views

converting BASH to Python (v2.6) [closed]

I have this code in bash and do not know how to translate the lines with 'ps -C.....' and ' ps -eo....' any help in how to write these lines? if [ "$SwapUsedActivity" == "true" ] then echo ...
0
votes
2answers
39 views

not command 'subl' found, trying to open ~/.bash_profile with it

NEWBIE QUESTION!! Hi guys, I'm trying to open the ~/.bash_profile file I just created with 'subl' command, I created the ~/.bash_profile file using the touch command, as follow: touch ...
2
votes
3answers
65 views

Compare Strings in Bash

Heres my code (so far): var=$(sudo cat /dev/ttyUSB0) echo "$var" if [ "$var" == "OK" ] then echo "Everything is fine" else echo "Not OK" fi As the output of this script is ...
0
votes
0answers
34 views

Environment variable to all usersE

I cannot able to set PATH variables gloablly. I tried: $ mvn -v mvn command not found Tried to edit /etc/bashrc: Permission Denied Logged in as root: $ su - root modified /etc/bashrc ...
2
votes
1answer
29 views

Shell calling shell(s) and passing env variable(s) or not

I want to launch/run /usr/bin/FreeFileSync (FFS) from my crontab at most once a day, whenever the external backup target volume is mounted. For that, I used @Germar's answer: i.e. a spooling-script ...
0
votes
0answers
223 views

Odoo (OpenERP) start-stop-daemon script

I installed odoo and try manual start openerp-server. All ok. My next step it's try to add odoo to auto start. For this I use this script: #!/bin/sh ### BEGIN INIT INFO # Provides: ...
3
votes
1answer
129 views

How to hide stderr without “muting” user input

To put it simply, I have a script that uses read -e to grab user input, but because of the environment, lots of 'broken pipe' messages pop up and pollute the display. I wanted to hide stderr, so I ...
1
vote
1answer
70 views

how to handle file names with spaces

I am developing a GUI search program. I need help to handle filenames with spaces. I just can't figure it out. Here is my code: #!/bin/bash USERNAME=$(whoami) INPUT=$(zenity --entry) updatedb ...
2
votes
0answers
48 views

cron.daily gives apt error. “not found”

I recently upgrade to Ubuntu 15.04 and after that I get these strange errors in my cron e-mail. Sadly I didn't remember what version of ubuntu I was upgrading from but I think it was the latest before ...
0
votes
1answer
21 views

Gtk-WARNING ** Inhibit called with an unrealized window

While setting up a script to run a slideshow in Bash, I ran into an annoying problem. The slideshow will run just fine, but in between pictures (or movies) it will display the desktop, and the screen ...
2
votes
2answers
38 views

Using top command i wrote one script and output also stored in doc file with date in single line

I am monitoring my cloud server so I wrote a script using top command and stored the output file in single line with date , but its not working (date)&&(top -n 1 | grep firefox) >> ...
0
votes
1answer
77 views

Copy unmatched strings in from one file to another, bulk

I'm trying to compare files from folder1 to their updated version in folder2. The files have identical names, but may have different number of strings. The strings look like: string_1_name: "some ...
4
votes
4answers
458 views

Can't run Bash script

I am trying to run a simple Bash script called deploy-site.sh (by http://klau.si/dev). I made the necessary edits to run it locally (change of WORKDIR, etc). I also followed the instructions here. ...