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

learn more… | top users | synonyms (1)

7
votes
1answer
131 views

How to execute a terminal command every time the firefox windows closes

I need to execute this: rm -rf ~/.wine-pipelight/*; rm -rf ~/.wine-pipelight/./.*; cp -a ~/viewright_backup/. ~/.wine-pipelight every time the Firefox window closes. But not necessarily when all ...
6
votes
1answer
86 views

Can I run bash commands from an Ubuntu HTML5 App?

I want to convert some bash scripts into GUI apps using the Ubuntu SDK to create an HTML5 app. Is this possible? Are there any tutorials besides the 'Meanings' one that demonstrate this?
3
votes
2answers
129 views

.bashrc shebang line reports command not found

Tried the following shebang lines: $ head -n2 .bashrc | od -c 0000000 357 273 277 # ! / b i n / b a s h \n $ bash bash: #!/bin/bash: No such file or directory .bashrc starts ...
-2
votes
0answers
30 views

What other scripting languages that are related to bash?

I know that Bash Scripting is very useful & primarily a scripting language to learn with easiest way for running day-to-day commands intelligently/logically. Now, I want to know which are other ...
2
votes
1answer
77 views

How to write a script to run different application

I am very new to linux platform. Looking for a script file to call different application start up file located in different location and needs to be run in different terminals. For example : i ...
0
votes
1answer
37 views

How to get dialog box input directed to a variable?

I have been teaching myself bash scripting and have run into an issue. I have written a script to take input from the user, using the 'read' command, and make that input a variable to use later in the ...
2
votes
2answers
29 views

MRTG using script to grab data of sensors

I'm using MRTG to grab data from sensors of a ubuntu server 12.04, with this script. #!/bin/bash SENSORS=/usr/bin/sensors UPTIME=$(uptime | awk -F, '{print $3}' ) TEXT="Graphic Card Temperature" ...
1
vote
3answers
42 views

sed replace text containing new line

I have a bash script for installing a web server on my Ubuntu server. I'd like, in the /etc/apache2/apache2.conf, to replace #ServerRoot "/etc/apache2" # by #ServerRoot "/etc/apache2" ...
0
votes
0answers
23 views

arecord flac format

I am playing with scripts that use the google speech-to-text api. The api requires flac encoded files so the recording part of the script looks like this: arecord -q -t wav -d 0 -f S16_LE -r 16000 | ...
0
votes
1answer
41 views

Change my keyboard layout for my profile only

We are using ubuntu-server 14.04 , I want to change the keboard layout to querty only for my login , i want the other users remain having azerty , I know that I have to put a command line in some ...
5
votes
3answers
159 views

How do I make a custom path identifier?

To define what I mean by "custom path identifier", I mean a short set of character(s) that represent a whole path, and example of this would be the ~, if you type cd ~ in your Terminal Emulator it ...
1
vote
1answer
25 views

Mounting virtual shared folder - mount succeeds, but any access to folders hangs

I have been using the following script to mount virtual box shared drives in my guest Ubuntu (with host Windows) #!/bin/bash # Mounts all known drives shared via virtual box # ...
0
votes
0answers
28 views

Init.d script not updating git repository

I have the following init.d script running on my ubuntu machine: # /etc/init.d/do-updates cd /home/ubuntu/Fox;git pull sudo /home/ubuntu/Fox/batch_update_process.py 1>> ...
1
vote
2answers
32 views

saving multiple files with cURL

I have this list of URLs in a .txt file -which i'm suppose to get content of them. To achieve this, i decided to use cURL. With xargs curl < url-list.txt , i can display all the content of the URL ...
1
vote
1answer
20 views

~/.inputrc is missed in ubuntu 14.04 => Cannot create a key binding

I want to add this key binding in the suitable conf file : Control-t: "top -Ss \C-m" Which means : Bind Ctrl+T keys to top -Ss command line . i enter on terminal sudo ls ~/.inputrc to check ...
0
votes
0answers
72 views

After exporting $PATH, commands don't work anymore

Trying installing Java, I tried to add it to the executable path with the line: export PATH=/usr/lib/jvm/jdk1.7.0_60/bin:$PATH in the system-wide /etc/bash.bashrc file. For some reason this ...
0
votes
0answers
34 views

Alias's in .bash* not working

I am trying to create an alias and it does not seem to be working. I have tried it with both .bashrc and .bash_aliases. If I open my terminal and perform source .bashrc, then they work OK. What am I ...
1
vote
1answer
40 views

Turn off/sleep after script completion

I have a little script. It's ripped out of a Youtube tutorial, untested, ugly, and not very good. It's not done and not intended for public use. Here it is: #!/bin/bash sudo apt-get -y install git ...
-3
votes
1answer
43 views

Store the return string to a variable from zenity

I am using Zenity tool to pop-up an entry dialog box. But how can i store the value entered into the text box to a variable ? Now, the string is being printed onto the console itself. I want it to be ...
0
votes
1answer
22 views

How to filter grep results?

I am new at writing scripts. So I am hoping this is simple. The script I am writing is used to gather system information and save it as an html file. When I run: sudo lshw -short it list all of ...
0
votes
1answer
32 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 ...
2
votes
3answers
47 views

automate multiple file conversions

I need help fixing my script to automate multiple file conversions. I am working on the server and I am trying to find a way to convert files automatically. The conversion needs to be made through ...
1
vote
3answers
38 views

BASH: write the output of a command to a file

I run a program multible time using a bash script, and I want it's output to be written in a file. However, I couldn't make the operator ">filename.txt" work... Here is my script: for i in ...
1
vote
2answers
35 views

Echos, variables, and help with this question

The book Learning The Bash Shell says- "Notice that we used double quotes around variables (and strings containing them) in these echo examples. In Chapter 1, we said that some special characters ...
3
votes
4answers
217 views

Redirect an output to a file from command piping grep

I am running this: cat /dev/urandom|hexdump| grep -i "ffff f" > random and I get nothing in file random, it remains zero length after the command is interrupted. How to make it writing output ...
1
vote
3answers
52 views

script skipping user input in nested case statement

I am trying to create a nested case statement in which user input is expected (Y/N). However, the system never waits for the input and always goes to the third option, "Please answer yes or no". Can ...
1
vote
1answer
23 views

Adding multiple text lines with 'convert'

I'm trying to place multiple lines of text on an image, but the following produces the following error: convert convert: Non-conforming drawing primitive definition (\) [No such file or directory]. ...
2
votes
1answer
72 views

Automate Google Chrome installation on 14.04

Is there a way to completely automate Google Chrome installation on a new machine? I have the following commands working in a bash script: cd /tmp wget ...
1
vote
0answers
41 views

How can I draw selection rectangle on screen for my script?

I am trying to make a simple screencasting bash script. I want to get screen selection coordinates by drawing a red rectangle with mouse. I can use xdotools to get coordinates but how can I draw ...
0
votes
0answers
24 views

Issues with Grep

Why does the bottom line output "0" into the "AD-Results-$month-$Y" file? First grep command fgrep "$month $D $i:" $Filetmp > TempOutput Grep command to read "allows" from tail of ...
1
vote
1answer
43 views

bash : update apt-get only if apt cache is older than 10 minutes

I'm trying, with a script, to test if apt cache is older than 10 minutes old if [ "($(date +%s) - $(stat -c %Z /var/lib/apt/periodic/update-success-stamp)) -ge 600000" ]; then echo true fi But it ...
1
vote
1answer
26 views

how to test if the apt cache is up to date with bash

I'm searching a way to test in a bash script if a cache update is needed (to avoid unnecessary apt-get update when the apt-cache have been updated recently). can someone help me?
1
vote
1answer
28 views

Echo script arguments from function

I need to get script arguments within function with arguments. ./myscript 1 2 3 function_name () { if [ $1 == 3 ]; then # I need the $1 in the following echo to be the script argument, ...
0
votes
1answer
178 views

TangoWithDjango .bashrc edit causing errors

I'm currently doing the Tango with Django module and I've edited my .bashrc as it lists. Appending [[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc to the end ...
2
votes
1answer
38 views

Trying to use GNU Parallel with sed

Why does this line do nothing? I'm trying to run a "sed" command in parallel and it outputs nothing to "standard.txt" $Filetemp = the file I'm stream editing standard.txt = the file I'm outputting ...
0
votes
1answer
14 views

dconf change a string key

I'm trying to change a string based dconf key with a bash script, using the following command line: dconf write /org/gnome/nautilus/preferences/show-directory-item-counts 'never' But it return the ...
2
votes
1answer
51 views

Why is my cron script to dump a MySQL database not executed?

I have the following cron job: * * * * * /home/db_backups/test.sh which runs fine and is executed every minute. If I check with sudo grep \(CRON\) /var/log/syslog I get the following: Jun 23 ...
0
votes
2answers
79 views

Lilypond install not working

I'm trying to install Lilypond on a 32-bit system, and for some reason the sh file simply does not want to execute itself. I'm completely new to Ubuntu, so I have next to no knowledge of how anything ...
-5
votes
5answers
72 views

List hidden files without using - ( * | [closed]

Is it possible to list hidden files without using the characters mentioned above? This means not using any options or the * wildcard as well as some other characters (e.g this is not allowed "ls -a", ...
-1
votes
0answers
53 views

Ubuntu 14.04 /etc/init.d/script got SIGSEGV in pthread_mutex_lock during boot but execute fine if manually started

A long title, sorry for that, but i wanted to provide as much info as possible. So here is my main problem: I have a an initscript: /etc/init.d/script_test and updated rc.d sudo update-rc.d ...
0
votes
0answers
21 views

<Enter> button does not work in Guake for zsh

I have 2 machines with Ubuntu 14.04 on them. On both machines I've tried to switch shell to zsh for Guake. As a result pressing button (to run a command) has no effect, although other ...
0
votes
1answer
35 views

Ubuntu 14 - unable to use sudo echo to overwrite files [duplicate]

For ubuntu 12.04 bash scripts, I used to be able to run commands like the example below to overwrite files: sudo echo 'line1 line2 line3' > /etc/some/config/file.conf Ever since Ubuntu 14.04, ...
2
votes
2answers
210 views

Unexpected end of file

Can someone explain why the end of the file is unexpected on line 49? (Line 49 is one line after the last line) #!/bin/bash timeend=$(date -u +%H%M) timestart=$(date --date "$timeend 30 minutes ...
1
vote
2answers
59 views

How to use -exec option in find command

I wanna solve some problems in compiz with my brain and hands. By the way I entered following command to build compiz from source in Ubuntu 12.04 find /opt/compiz-built/share/gconf/schemas -exec ...
1
vote
3answers
63 views

Print only the first match once

I have a code snippet that I am using to parse through a log file and print information I need. for i in $(cat ~/jlog/"$2"); do grep "$1" ~/jlog/"$2" | awk '/\([a-zA-Z0-9.]+/ {print ...
0
votes
1answer
29 views

Is there other way to get your DISPLAY env without using shell?

I have a script that will get executed by incrond when it sees changes in a watch dir. There is only a few env vars that are available in the script, the rest get cleared by incrond. So this becomes a ...
0
votes
1answer
34 views

Can someone explain what this grep/cut/awk command is doing

This is inside of a .sh script file: cd /somefolder IP=$(ifconfig | grep 'inet addr:'| grep 168 | grep 192|cut -d: -f2 | awk '{print $1}') The /somefolder has another folder list with a single ...
0
votes
2answers
44 views

Regular expression

I have a code that is looking for a specific pattern in my log files. Usually it begins with Association ID = (This is what I am looking for in parenthesis). Now the code I have made so far is ...
2
votes
2answers
106 views

Shell Scripting Function question

I have this code snippet I am working on for a small project I am doing: echo "Please enter SUID: "; read $uid uid_Assoc(){ arg1=$1 echo $1; } uid_Assoc Now to start, I would like ...
4
votes
3answers
321 views

Bash / Python error handling?

I am trying to execute very basic Python code containing error handling as a Bash script, but while the code seems to run OK in Python, the code generates problems when executed under Bash. ...