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

learn more… | top users | synonyms (1)

1
vote
1answer
31 views

Alternative for |(pipe) operator

I'm looking for a alternative for | operator in bash shell for redirecting output of command as input to the next command. Is there any alternative? something like : command1 | command2 | command3 ...
1
vote
1answer
31 views

ping command in bash shows heart character

Why am I seeing a heart ♥ after the ping command? I'm running the command below over an ssh connection in ConEmu, if that changes anything. Is this expected or have I been hacked in some fashion? ...
2
votes
1answer
540 views

Bash command-line in vi mode - command-line find/replace [duplicate]

New to linux :-) In my .bashrc I have set -o vi. That way when I'm in the terminal I can press CTRL +{ and then use VI commands to navigate, edit and search the command history. One thing I cannot ...
0
votes
1answer
24 views

cant cd to a directory error while moving files to another directory

I have written the following code to MOVE ALL THE TRACE FILES CREATED BEFORE 2 MINUTES TO A SEPARATE DIRECTORY. Now when I am hard-coding the source and target path in the script, it is working fine; ...
0
votes
0answers
16 views

Increasing ALSA's buffer size

I'm trying to change ALSA's original buffer size, in order to increase it. Until now, I had no luck. I've tried to execute the commands listed in http://pastebin.com/4FibYN0U, however,I don't have ...
0
votes
2answers
141 views

How to auto restart a command after it closes down?

I am using rtmpdump to restream live video on my local network on nginx rtmp server. like this: sudo rtmpdump -r "rtmp://123.45.6.7/live/" -a "live/" -f "LNX 14,0,0,125" -W ...
0
votes
1answer
22 views

My bash script only opens editor, why doesn't it run? [duplicate]

I created a script to dd sdb to sdc on my older computer with Ubuntu 13. It ran when I clicked on it – asked if I wanted to run in terminal or edit it. On a newer computer, with Ubuntu 14, I created ...
24
votes
2answers
98k views

How to use variables in 'sed' command?

I try the fallowing code and it does nothing var1=QQ sed -i 's/$var1/ZZ/g' $file However this code replaces QQ with ZZ sed -i 's/QQ/ZZ/g' $file How to use variables in sed?
11
votes
3answers
9k views

Can't make ZSH the default shell

I am trying to set ZSH as my default shell, however it keeps reverting back to bash. I have tried this code: sudo chsh -s $(which zsh) I've also tried: sudo chsh -s /bin/zsh Also tried these ...
0
votes
1answer
16 views

“Permission denied” when download from script(ruby) file [duplicate]

I want to download a project's dependencies from a script file in tutorial said: run this comment to download ./download-dependencies core my way was like this: $ cd Documents/ImageProccesing/ $ ...
29
votes
10answers
94k views

How can I create a select menu in a shell script?

I'm creating a simple bash script and I want to create a select menu in it, like this: ./script echo "Choose your option:" 1) Option 1 2) Option 2 3) Option 3 4) Quit And according to ...
0
votes
3answers
352 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
0answers
22 views

Change iface when internet is slow bash script

Need help with script that will change eth1 or eth2 ( to auto set different route ). I have eth0 that is shared to lan and two different gateways (routers), one on eth1 and second on eth2. For now ...
2
votes
1answer
16 views

How to Launch Terminal Script with Appliation Icon?

I am relatively new to linux, but I wanted to get my Tor browser up and running. I have downloaded and extracted the Tor Browser Bundle. In order to open the browser I need to cd to the file and run a ...
0
votes
1answer
39 views

Start a terminal on login and show a message

How can I write a bash that will execute at login and starts a terminal with message. pseado code: .bash_login #!/bin/bash gnome-terminal echo "hello user $username"; Just trying to learn some ...
1
vote
2answers
33 views

Will “kill -SIGTERM” stop “tail -f”?

Just as the title says, Google gives me nothing and I can't test it on this server. The command as is follows: tail -f <file> | fgrep --line-buffered "string" | sed -u 's/stuff//g' >> ...
1
vote
5answers
2k views

How to kill only if process is running?

Currently I use line like this in my sh script file: kill `ps aux | grep -F 'myServer' | grep -v -F 'grep' | awk '{ print $2 }'` But I wonder how to call it only if process (myServer here) is ...
1
vote
1answer
27 views

Is there a log of the output of “bash install.sh [ ]” available for Ubuntu server?

Following the advice of someone on this site I attempted to update a wireless device driver with: bash install.sh [] which I ran while in sudo. The update didn't work and I'm wondering if some ...
0
votes
1answer
29 views

How to use rsyslog?

I've been scouring forums for a few hours and cannot find a concrete explanation on how to use rsyslog. I really just need the basics. I have a log file logFile.log and I want to forward the logs to ...
4
votes
3answers
4k views

Tomcat does not recognize JAVA_HOME

I've installed Ubuntu 14.04 Server, extracted JDK1.8u5 and Tomcat7, and added the following to .profile (I also tried adding it to .bashrc with similar [non-] results): export ...
1
vote
1answer
30 views

Does order of precedence with ENV variable changes which program to use?

Question: Does order of precedence in the PATH influence Ubuntu to choose which program to use? More details: I use .bashrc for declaring private env PATH, I have installed MSP430-gcc from ubuntu ...
0
votes
1answer
23 views

piping in real time

This is more a conceptual thing than a current problem. Would it be possible to do this: tail -f <file> | grep "string" | sed 's/stuff//g' >> output.txt The problem I'm thinking is that ...
1
vote
1answer
38 views

Start script on boot up?

I want to run a script when the system starts. The script is: #!/bin/bash gnome-terminal --tab -t "MyPC" -e "sh -c 'nohup firefox & nohup gedit & bash'" --tab -t "MYPC2" -e "sh -c 'ls -al;ls; ...
-1
votes
2answers
56 views

Shell Script to check for subdirectory [closed]

A. I used the following code to get the modified date of a file. But this is also selecting the subdirectories and thus returning an error. How can I fix this? for file in $1/*; do echo `stat ...
0
votes
1answer
52 views

Use find command but exclude certain directories [closed]

I am trying to run the make command, but it says make: *** No targets specified and no makefile found. Stop. After doing some research, it seems that the error is because I need to run ./configure ...
0
votes
0answers
62 views

Bash script is not working. Could somebody help me?

E: Hi, i could use some help. I am sorry that some parts of the bash are in german. There are sure some mistakes in there but i can not find them i tried severel hours right now. I would be happy if ...
56
votes
4answers
28k views

Hide current working directory in terminal

As a default, the terminal prompt shows something like: user@system:/folder1/folder2/folder3/folder4$ the deeper you go into the filesystem, the less space is left for typing in commands. Can I ...
2
votes
1answer
21 views

How to run a complex command by xfce mail-watcher

I just installed the xfce4-mailwatch-plugin I would like to use the option "Run on click" to either switch to Thunderbird, or to open it if it is not currently running. The command I use for this is ...
0
votes
0answers
28 views

Crontab wont run this script!

I am trying to run this script as a cron job to enable a weekly back up of my mediawiki site. Running on Ubuntu server 14.04. It simply will not run. The scipt is running from the root folder of the ...
1
vote
3answers
484 views

how to check if PPA is already added to apt sources list in a bash script

Do someone know how to check if a PPA is already added to my system before i add it with the add-apt-repository command in a shell script. That would be very helpful. Thank you.
1
vote
1answer
38 views

Is there a way to reprogram the thinkvantage button to assign a shell bash program to it?

Is there a way to reprogram the lenovo think vantage button to open and run a shell bash program on ubuntu 14.04 lts? I have tried system preferences > keyboard >shortcuts > custom and assigned a ...
0
votes
0answers
31 views

How to make a shell bash login [closed]

How to make a login page using shell bash and a csv file with the user names and passwords in This is then to be able to run some functions Ubuntu 14.04 Desktop
0
votes
0answers
9 views

Revkit Gui Interface Error

I am trying to install Revkit 1.3 in Ubuntu 10.04 LTS. Successfully ran ./make.py bootstrap and ./make.py build, but after giving the command /tools/gui/gui.py I get the following message: Traceback ...
0
votes
0answers
15 views

reprepro - Is there any chance to enter the passphrase via bash-script?

I use "reprepro" for getting the latest Debian packages out of my local repository, which works fine manually. Now I need to automate this process through a cron job but the reprepro passphrase is a ...
0
votes
0answers
18 views

ssh connection problem

Hi everyone i am developing a robotic app, i want to run my launch files under a ssh connection with this script but when i run script it wants may password, i write it but nothing happens although i ...
0
votes
2answers
63 views

Run a script every time a shell is spawned

I need a way to make a script run at all times under all users and to automatically start if any new shell is spawned. Any ideas?
0
votes
2answers
19 views

Deleting an entire line in a file that contains a certain string

I'm interested in figuring out a way to delete an entire line in a text file that contains a particular string. This will be for a text file that operates like a phone book containing names, address, ...
0
votes
2answers
15 views

Using Grep to search for multiple words in a file

I want to use grep in an If statement to search for a first-name and last-name within a text file. I can't seem to make it work on my own. if [[ grep -E "$first|$last" Datafile.txt ]] then ...
0
votes
0answers
11 views

Unable to set env var for ssh key-based login

I have a ssh key based login and I cannot see env variables that I set in : .bashrc, .profile, /etc/profile.d/setup-my-env.sh export PATH=$PATH:$HOME/opt/openmpi/bin export ...
0
votes
1answer
17 views

Syntax Error: Unexpected end of file

I'm trying to run this script below and I have no idea why its not working. I keep getting an error message that says "Syntax Error: Unexpected end of file" and I don't know how to trouble shoot this ...
0
votes
1answer
22 views

Own brightness script, problem with missing ']'

I'm starting my adventure with Ubuntu ( I'm a MS's kid :D) and I would like to create my own scripts for controlling the brightness. I know all about the xbindkeys, and how does it works, but there is ...
2
votes
0answers
42 views

How to have a video player resume from where I last left off?

I'd like to be able to launch a video player (VLC, SMPlayer) via Terminal, using some command like resume_media and then it will automatically find the most recently played media file (.mkv, mp4 etc.) ...
2
votes
1answer
7k views

Tomcat Installation startup.sh not working

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04. When I try to run the startup script, I get this message: ...
1
vote
1answer
27 views

Silence GUI Program's Terminal Output

I am running a zsh function to open a .tex file in vim, while opening its related .pdf file in evince. I am currently using xdotool to open a new tab in the current gnome-terminal window, and then ...
2
votes
3answers
14k views

Desktop directory not opening

I am completely new to Ubuntu or any distribution of linux altogether. While using the terminal, when i am in the /home/username directory the ls command shows Desktop and Download directories but the ...
0
votes
1answer
22 views

How to delete backup files using a bash script? [duplicate]

I want to automatically delete the backup files(those ending with ~) from everywhere on my computer. I tried to write a simple script usinglocate command, but I'm stuck at deleting file having space ...
0
votes
1answer
21 views

How do you create an additional interpreter?

Short and sweet version: I figured breaking it down into steps would make it easier. I'm building a website I hate SQL. It makes no sense to me, for a programmer to have to learn an additional ...
0
votes
1answer
30 views

Checking for a file and whether it is readable and writable

I'm trying to write a script that will look for a certain .txt file saved to my desktop. I want the script to be able to check if this file exists and then check to see if it is readable and ...
1
vote
3answers
90 views

Bash command to convert IP addresses into their “reverse” form?

When I run nslookup on an IP (These are all examples) nslookup 192.168.1.123 Current output: 411.311.211.111 Desired output: 111.211.311.411 I have a script that works just seeing if there's ...
0
votes
1answer
11 views

How can I activate my Apple Remote

I have a A1294 Apple Remote model no 2B9450C4RBRCA that I can not configure for my Ubuntu desktop.I have built all my dependancies for lirc,but it still doesn't show up,it's important to note that ...