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

learn more… | top users | synonyms (1)

0
votes
3answers
917 views

How to clear history on logout

I tried adding history -c to ~/.bash_logout but seems not working. Add: I'm having success by adding these lines into my ~/.bashrc (referred from here) unset HISTFILE export ...
1
vote
3answers
4k views

Command to run GUI Frontend for apt-get update

I want know, if there is any command to run apt-get update in GUI like in the picture following: All i want to do is to write a script which will update the software sources through this gui ...
10
votes
6answers
7k views

How to get the URL from a file using a shell script

I have a file which consists of a URL. I'm trying to get the URL from that file using a shell script. In the file, the URL is like this: ('URL', 'http://url.com'); I tried to use the following: ...
4
votes
5answers
483 views

If for a command to check if it succeed

I'm working on my bash script to create logical volumes. I have this command which I want to put in a if to check of each of these succeed. What is the easiest way to do that? #!/bin/bash pvcreate ...
1
vote
1answer
6k views

cat: write error: Broken pipe

I'm running a command: cat urls.txt | xargs -L 1 -P 5 timeout 40 wget This downloads all the URLs in urls.txt This used to work fine, but recently I changed the URLs I am downloading from ...
0
votes
1answer
175 views

How to check if last command succeeded and make that command auto accept prompts?

I am working a script to create a raid5 array. The question is how to put the command in a if (to see if the command succeeded), and when the script ask to continue creating array it will auto say ...
0
votes
2answers
1k views

How to solve -f : command not found

I'm trying to check some files existence using -f command followed by the file bath but I have an error. This is my script: initUCounter="/home/teeba/users_counter_initial_value" ...
1
vote
1answer
1k views

I have problem while opening terminal

When I am trying to open Terminal, It show me error like this "There was an error creating the child process for this terminal. getpt failed: No such file or directory." with two buttons 1. profile ...
2
votes
1answer
4k views

How to store the array length in a variable in bash scripting language

I stored some information about the system in an arrays .. and I tried to store the length of an array in a variable then print the value of the variable on the terminal , but there is no output! ...
0
votes
2answers
736 views

How to split string in bash and store the tokens in array

I wrote this script to store some information about my machine such as the users and the running processes . I tried to store the retrieved data into an array. To test array I printed the length of ...
2
votes
1answer
486 views

Bash script to check if mdadm is installed if not it will install it

Working on a bash script which first will check if mdadm is installed, if not it will install it. This is my script but it's not working correctly. Hope someone can help me. if [ "$mdadm" = "mdadm" ...
0
votes
2answers
530 views

Adding 'soft link' to julia

I would like to be able to open the software "Julia" by simply typing 'julia' in a terminal at any location (like I can do for, say, firefox). Currently I have to type cd ~/julia ./julia According ...
1
vote
1answer
654 views

Running a command in a new terminal instance in a bash script

I have a bash script where I configure my proxy settings automatically. I have created some aliases in the .bash_aliases file. Now there is one command where I ssh into my remote server and do some ...
5
votes
2answers
142 views

What “echo !T ” do?

I don't know how many of you have encountered this, but I find it interesting. Maybe also because I do not totally know what the "echo" command can do. If anyone has the interest and nerves to give me ...
3
votes
2answers
444 views

Determining the name of the host currently connected via SSH

When logging in via SSH, I'd like to know, during the execution of .bashrc, the name of the host that is connecting. Ubuntu Server shows the prompt: Last login: Fri Feb 14 11:34:55 2014 from ...
2
votes
1answer
153 views

Bash script to check if mdadm is installed if not install it

I am currently working on a bash script to create raid5 with 3 disks and one hotspare. I am confused of how to create a script which first check if mdadm exist, if not it will install it and name it ...
2
votes
2answers
632 views

Temperature & RAM monitoring script

I have the following script: while : do clear; echo "---------------------------RAM Load------------------------------$ free -mt >> memory.txt; free -mt; ...
0
votes
1answer
824 views

math operations from array elements in bash script [closed]

Using Ubuntu 13.10, bash and zenity, I am building a simple checkbook utility. In the code below, the section with all the commented math commands are the ones that I have tried. There is also a ...
-1
votes
2answers
176 views

Bash script download dynamic directories

How to download the most recent packages in deb files (all in a folder) for my platform (x86_64/i386) & distro with bash script? There is no PPA for this apps. So I'm interesting in ...
0
votes
1answer
256 views

System Monitor Script

I created a simple script written in bash to constantly monitor my system temp and RAM free. while : do clear; echo "---------------------------RAM ...
20
votes
4answers
24k views

How do I check virtualbox version from CLI

I am writing a Bash script to store the version number of Virtualbox, but cannot succeed. My Script is: #!/bin/bash installed_virtualbox=$(virtualbox --version) # --version this is what I want to ...
0
votes
2answers
97 views

How to redirect all manuals to files?

Just for fun, or say for sake of convenience, I decided to write out all man pages to files. Now if I have to do it one by one, I would do man package-name > filename. But I want to do some ...
0
votes
1answer
42 views

ubuntu rightclick command line custom backup

os: ubuntu 12.04 LTS, kernel: 3.8.0-35-generic kernel, when i right click on "text file/s", i would like to have a custom menu, to run a bash, to make a backup copy of text file/s i'm right clicking ...
0
votes
1answer
101 views

config file of shell complete

I want add autocompletion to my script. I wrote bash code for autocomplete (using this tutor http://tldp.org/LDP/abs/html/tabexpansion.html) and put it to /etc/bash_completion.d/ then i execute in ...
3
votes
3answers
2k views

Nemo Custom Action (.sh script) does not execute

I created a .sh script for simple OCR-ing of screenshots that I make with Shutter. The script looks like this (ocrFile.sh): #!/bin/bash convert $1 /tmp/output.pnm cat /tmp/output.pnm | pamstretch 4 ...
1
vote
3answers
70 views

sudo cannot do cd [duplicate]

I found the strangest thing sudo cd $pwd sudo: cd: command not found I am able to cd as a normal user.It seems that PATH is not set properly for su. How do I fix that?
5
votes
1answer
922 views

How to save live log bash input to a file?

When I am teaching a class, some students have problems following my CLI commands and would like to scroll back to be able to repeat the steps in their own speed. So I'd like to log all my inputs in ...
2
votes
1answer
65 views

Arithmetic with variables

I am trying to do arithmetic as I assign a variable a value. When the script reaches end_day it cannot do the math, and when I test it in the terminal it will simply return the expression. What do I ...
1
vote
1answer
95 views

How to make the path of a symbolically linked directory the exactly the path of the original directory?

I have created a symbolic link on my desktop that links to my /var/www/wordpress dir via $ ln -s /var/www/wordpress/ ~/Desktop/wordpress-link When I open bash and cd into ~/Desktop/wordpress-link I ...
3
votes
3answers
741 views

How to concate strings in a bash script to use in SQL-Statement? [closed]

I would like to do the following in a bash script: read some filenames out of an file with filenames set a variable input path concat 1. and 2. use 3. in sql-statement Here my code: ...
1
vote
1answer
940 views

mysql statement in bash shell script does not work / syntax error

hope someone can help me! I do not know what's wrong with this script (Bash / Ubuntu 12.04 / Mysql / XAMPP 1.8.3). Try to read an input file with a list of csv-filenames (449-R11, 449-R12 ..) in order ...
0
votes
1answer
357 views

find -exec not working properly, why?

I am trying to list all the file names (the basename, not the full path) below my home directory using find. I tried to do: find ~/ -type f -exec echo $(basename "{}") ";" However I end up having a ...
3
votes
1answer
23k views

Open firefox from bash file “Error: no display specified”

I need to open a browser and access my server with the ip address 1.2.3.4. First I ping my server and if the ping did not fail I launch the home page in a browser. For this I have written a bash file ...
0
votes
1answer
103 views

How to find unspecified repetition in lines of text

I have educational videos that I am trying to burn to a DVD using Bombono DVD along with their corresponding subtitles. The subitles (.srt files) have the following format: 1 00:00:00,000 --> ...
0
votes
1answer
50 views

Terminal does not return when typing

I know this is weird but out of the blue, today I copied a long command into the terminal and instead of word wrapping as its supposed to, it started overwriting the same line. The command executed ...
2
votes
1answer
672 views

How can I open and close an SSH tunnel along with Firefox?

I have a proxy server which I connect to like so ssh -L 2001:localhost:8888 -N myserver.com -p 443 I then open up Firefox firefox -p "SSHProxy" (It starts Firefox configured to use port 2001). ...
0
votes
1answer
163 views

SSH alias results in SSH usage instructions

I have the following alias in my .bash_profile file: alias rlogin="ssh -l elykl33t rlogin.server" Of course this is not the actual username or server address. When I, after relaunching terminal, ...
0
votes
3answers
166 views

Strange autocompletion behavior

Well...I'm so confused, cause the only real problem in my case is freaking apostrophe ('). Situation: expanding PATH variable influence word completion, based on whether was apostrophes in additional ...
1
vote
1answer
2k views

permission denied in running script

I am running a script but there is an unusual warning: This is what happened in my console #whoami root #ls -l test.sh -rwxr-xr-x. 1 root root 1894 Feb 2 01:58 test.sh* #./test.sh -bash: ./test.sh: ...
0
votes
1answer
68 views

can I get the launcher to “re see” open processes?

I've got about 8 gnome-terminal tabs open in one window. For some reason, the launcher is not aware of this window suddenly. When I click on the gnome-terminal symbol in launcher, it won't slide the ...
0
votes
3answers
1k views

Copy current terminal prompt to clipboard

Is there a way to copy the currently written content of the bash prompt? Say I wrote: ping www.google.com so that the lines in terminal looks like: petr@sova:~$ ping www.google.com and didn't ...
2
votes
5answers
20k views

ping multiple IP's using bash?

I have 10 IP numbers which I have to ping daily for checking , How I can do that by using BASH script. So that I can automate that task by using cron. I want BASH script only. Thank you.
1
vote
1answer
58 views

See the version of Bash in the prompt

When I open the terminal on the console I have user@Sytem-Product-Name:-$ and at work when ever I type bash I get bash 3.2$: (or something very similar, Note I'm using putty on other unix distro) for ...
0
votes
1answer
565 views

Running bash loop

I've created a while loop in a bash script to run a couple of PHP commands. The reason why I've created the while loop is because I can't use cronjobs (I don't want to create a new instance of the ...
1
vote
1answer
386 views

ADT Bundle .bashrc $PATH not working

I Installed the ADT bundle, worked fine the first go, even from a Gnome custom launcher. Didn't test ADB or FASTBOOT from CL, subsequently neither nor ADT is working. echo "$PATH" /usr/local/sbin: ...
-2
votes
2answers
628 views

How to make a script that backup System in Ubuntu 12.04?

I need a script that when I execute it, it will backup the system to a specific folder (destination). I'd also like to exclude some files.
4
votes
1answer
559 views

bash autocomplete feature doesn't work when I create function for emacs

Details about my system: I am running Ubuntu 12.04.4 LTS on Oracle Virtual Box 4.3.6, from Windows 8.1 installed on an Asus Laptop. I'm using bash_completion version 1.3 release (I got this from the ...
5
votes
2answers
181 views

What is meant by “bash”?

I have been using Ubuntu for a short period of time. I have seen the term "bash" in many places, including a terminal. I have still not understood what it is. Can somebody please explain clearly?
2
votes
1answer
141 views

Non-deterministic behaviour in bash script for screen window opening and naming

I have the following bash script to set up a screen session with four windows from the command line in 13.10. Comments indicate what I think it ought to do. screen -dmS mysession # start screen, name ...
1
vote
0answers
123 views

Matlab compilation returning an error when run

After putting in numerous hours, I felt ready to run my code on my friend's high end computer. I compiled my application (named Zeta). However, when I entered: sh '/home/nicbit/Desktop/run_Zeta.sh' ...