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

learn more… | top users | synonyms (1)

0
votes
1answer
116 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 --> 00:00:...
0
votes
1answer
55 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
771 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
207 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
181 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
72 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 ...
2
votes
3answers
3k 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 ...
6
votes
5answers
31k 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
59 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
677 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
412 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
722 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
657 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
220 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
151 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
133 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' /...
28
votes
9answers
5k views

Desktop notification when long running commands complete

I'd like to have a desktop notification whenever a command that has run for more than, say 15 seconds, finishes. In other words, I would like all commands to be wrapped in something like this start=$...
1
vote
1answer
967 views

How to reduce the command line prefix length in Bash

How to reduce the command line prefix length (i.e folder name or path in bash)? For example: venu@venupc:~$ cd Documents/Code/new/ venu@venupc:~/Documents/Code/new$ I want to display present ...
0
votes
1answer
767 views

finding amount of memory usage of a command in bash

I wrote a program and now I need to measure it's performance so I use time to find timings but is there any command like time that I could run my program under it and have the amount of memory used by ...
5
votes
2answers
211 views

How to print new data on the same line?

Hello guys I always use sudo apt-get install <package-name> for installing any pacakge and every time I run this command I observe one thing Every time it says Downloading some packages (...
4
votes
2answers
3k views

How can I run command in a folder without changing my current directory to it?

may be it seems strange for you, but I want to run command in a specific folder without changing the current folder in the shell. Example - this is what I usually do: ~$ cd .folder ~/.folder$ command ...
0
votes
1answer
569 views

Unable to create a file in a certain location on Ubuntu

I'm trying to create a text file as below... mysql --host=localhost --user=root --password=11111 database1 << EOF SELECT * FROM table WHERE status = 1 INTO OUTFILE '/home/user/feeds/file.txt' ...
1
vote
1answer
3k views

export PATH doesn't work correctly

I have a problem with $PATH export. The only place I found where I modify $PATH is /etc/environment: ANDROID_HOME="/opt/ADT/adt-bundle-linux-x86_64-20130522/sdk" PROJECT_HOME="/home/tomaszchabinka/...
1
vote
1answer
599 views

Vim and screen: background color not reset when exiting vim

I use vim in a screen session. Whenever I end editing a file and exit vim the background of my terminal stays the same as in vim, rather than resetting correctly as it does when I am not using screen....
0
votes
1answer
698 views

Problem while running script

I am getting error while running kafka-zookeeper script. Command i tried to run the script is root > /etc/init.d/kafka-zookeeper start Problem 2014-01-22 13:05:26,683] FATAL Severe ...
0
votes
1answer
1k views

Bash script, cannote replace string in a file with escaped $ and &

I have creatd a shell script which takes a string as input. If the string contains '$' or '&', then I need to raplace those characters with '\$' and '\&'. I could done that with sed command. ...
4
votes
1answer
9k views

Search specific text from file and output the line (Shell script)

Suppose I have a variable $str1 str1="20140121-21:48:26|Joanne Frances|" What I want to do is search that part in the file. The file contains, for example: 20140121-21:48:26|Joanne Frances|Perez|...
0
votes
2answers
156 views

.sh not running and getting no errors

I am try to create a .sh file to check to see if the server is running and if not to start it. i am not getting any echo's from this script or any fails but it is not running. can some one help me fix ...
4
votes
2answers
6k views

Add seconds to a given date in bash

I have a complete date plus hours and minutes. I would like to add a number of seconds and display the result as a date "day.month.year hour:minute". "date" doesn't seem to be able to add seconds to ...
2
votes
1answer
1k views

Yad list columns

I need some help with Yad. This is my code: contact=$(while read line do firstname=$(echo $line | awk 'BEGIN { FS="|" } { print $2 }') lastname=$(echo $...
0
votes
1answer
23 views

export dist-upgrade packages to file

in dist-upgrade i want to use it in init3 and i dont have X and my internet speed is low. how to export dist-upgrade download packages to file to get another pc?
1
vote
1answer
377 views

Script for trimming with ffmpeg

I'm recording radio broadcasts via DVB-C and gnutv. To trim the recordings I use ffmpeg. The synthax takes rahter long to enter in Terminal. So I'm working on a script to automatize this. Hiere it is:...
0
votes
1answer
316 views

Installing ruby with rvm and making ruby visible to bash

I installed rvm according to the instructions from the official website. Then I installed two ruby versions While rvm was visible to bash, ruby was not. I was browsing the web for a solution and I ...
3
votes
2answers
3k views

Convert time stamp to seconds in bash

As far as I know, bash variables do not have a certain type. My problem is, I need to convert a time stamp (always in format: hh:mm:ss) to a single integer representing seconds. So I cut the hh, mm ...
0
votes
1answer
234 views

Simple bash script does not want to start at reboot

I've build a Play Framework Application (cool Java/Scala Web Framework) and would like to start it automatically like Apache2 or MySQL Server. For this I wrote a simple Bash script and did chmod +x on ...
9
votes
3answers
9k views

How set command in background,close terminal and get it back to fg?

I'm trying to find out how to run a command in the background and then bring it to the foreground later. I'm fed up of tutorials and answers where people state that it's simple, just append & to ...
3
votes
1answer
2k views

How can I remove CRLF line terminators from wget'ed file?

I want to download a pastebin a raw file, and I tried: wget http://pastebin.com/raw.php?i=LBVNiRXa -O somefile My only problem is that the file arrives with CRLF line terminators. Can I remove the ...
0
votes
2answers
75 views

Use input from a file for a command

I want to use the mac address stored in a file in aireplay-ng command. I want this command to be executed once with each mac address in the file. Can you please tell me how to do it? sudo aireplay-...
1
vote
1answer
3k views

Auto mount webdav folder

I want to auto mount webdav folder with bash script. My server resources very pool so I have a memory problem about webdav. Therefore, I have to umount webdav folder for clear cache and memory. But, I ...
4
votes
2answers
284 views

Bash built-ins with no manual entries

Why do some bash built-ins (such as dirs, pushd or help) don't have manual entries?
0
votes
1answer
8k views

Download AWK to Ubuntu

How to download awk to Ubuntu, since I tried to use asorti function and it told me that there is an error on this asorti. I tried many scripts that used asorti function and the same error occure!
1
vote
1answer
180 views

A shell file containing count but not showing when I try to run from crontab

I am new in writing shell script i write a script like this #!/bin/bash PID=$(ps -ef | grep "sh gps.sh" | grep -v grep | awk '{print $2}') if [ -z $PID ] then cd /opt/etrans/cronjobs cnt=$(...
1
vote
3answers
6k views

Writing a bash script to read a text file of numbers into arrays, by column, on Ubuntu

I'm trying to write a little bash script on ubuntu 12.04 and have little experience. Odd little problem converting a text file of numbers into arrays. I need all of the first numbers, second, etc into ...
1
vote
2answers
444 views

Is it possible to download all mp3s from a domain or URL?

I'd like to download all mp3s from the blog pinchy&friends. I tried the script for mp3 in "http://www.pinchyandfriends.com/dl.php?mp3=*.mp3"; do wget "http://www.pinchyandfriends.com/dl.php?...
2
votes
2answers
1k views

Why doesn't this shell script work?

I am trying to create a simple script which will resize images. Here it is: #!/bin/bash echo "Script executed from: ${PWD}" #copy image and resize it OUTPUT_IMG="newimg.png" PATH="${PWD}/${...
0
votes
1answer
73 views

How do I make a sh file for running my software automatically?

I want to make a sh file on my desktop to run a software for example "kerio-kvc" I made a sh file on my desktop with this content automatically #! /bin/bash sudo /etc/init.d/kerio-kvc start But ...
11
votes
3answers
4k views

Where can I find a complete reference for the $PS1 variable?

The default PS1 variable on my machine (Kubuntu 13.10) is this: \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ I'm looking for a reference for how the $PS1 variable works that, at ...
1
vote
1answer
1k views

Change multiple file names in sub directories in single line

I have a directory named backup. Backup contains several subdirectories named monday, tuesday, wednesday... each subfolder contains file named filename.txt I want to change all names filename.txt to ...
4
votes
2answers
1k views

Why can't I pipe into cd?

Why can't I pipe stuff into cd? Example: $ pwd >> ~/mloc $ cd / $ tail -n 1 ~/mloc | cd cd fails. If do: cd $(tail -n 1 ~/mloc), it works. I understand the last command I wrote works, but ...