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

learn more… | top users | synonyms (1)

12
votes
3answers
398 views

How to insert tabs before output lines from a executed command

Just a quick question. Is it possible to tab the output on Ubuntu 16.04 LTS? I've created two images below to try and illustrate what I mean by this.
0
votes
0answers
22 views

Script using zenity and ghostscript to compress PDF files modification

I need help to change the script I have to compress PDF files using Thunar file manager custom actions. The script runs well compressing one by one file, I want to make changes that all PDF files I ...
5
votes
3answers
227 views

Extract integers from file and output to another file?

I have the following file foo.txt: 1 AbcdJ 8192 Pak78 8291 I would like a bash script that extracts all the lines containing only integers (e.g. 1, 8192 but not AbcdJ or Pak78) and outputs it to ...
3
votes
1answer
124 views

Need help scripting with jar files

I need to launch 17 .jar files, one at a time, with a 7 second delay in between each. 3 hours later, I need to kill all java processes, but only those running on surge user. 3 hours later I need to ...
0
votes
0answers
16 views

gdialog does not allow entering or double clicking

The thing is, I have had pretty hard times with gdialog recently. Let's demonstrate the problem first with this bash code sample: #!/bin/bash source ./Functionlib temp1=$(mktemp -t tfile.XXXXXX) ...
2
votes
1answer
63 views

Trigger if directory size exceeds threshold

I have written a shell script to backup data to s3 and i want to trigger this shell script when ever the system storage space goes critical lets say when the system reaches 80% of its capacity. I know ...
0
votes
1answer
39 views

Crontab runs /etc/init.d/ scripts but won't run service restart?

I am very new to Linux so please bare with me. I'm writing a script to restart mysql and send me an email whenever it goes down. I'm using crontab to run the script every x minutes. I'm having an ...
-1
votes
0answers
24 views

scripts in /etc/cron.hourly not executing

I have placed my mysql backup script in /etc/cron.hourly, i even made it executable and also the script starts with the line #!/bin/bash. But when i run sudo run-parts -v /etc/cron.hourly my backup ...
1
vote
2answers
59 views

Grep in bash script won't work properly

I know there are many similar questions arround the Internet, but I couldn't find a solution for my specific problem. I made this script for an assignment, where I want to find which combinations ...
3
votes
2answers
1k views

Difference between | and ||

What is the difference between | and || ? When I run this command : ls -la | id I get the result of id When I run this command : ls -la || id I get the result of ls -la So what is the ...
0
votes
0answers
31 views

bash: cannot create temp…No space left on device. Have plenty of inodes [duplicate]

I get bash: cannot create temp file for here-document: No space left on device when using bash autocomplete. Most searches for this say the problem is a lack of inodes so I did df -i and got: ...
0
votes
1answer
13 views

Trouble taking auto backup of mysql database to amazon s3

I am new to this concept and i am using ubuntu14.04 lts O.S. I created a bash script which would take backup of mysql db, and also created a cronjob for a desired time. The thing is the backup is ...
0
votes
0answers
8 views

I want to install GUI applications on Bash on Windows [migrated]

I wanted to install some GUI applications on Bash on Windows but I got GTK_BACKEND doesn't match available displays. I searched for this error, but none of them actually solved it. I've tried pkexec ...
4
votes
1answer
33 views

One command to get a running py script ID then kill it

I once asked for a script to control unity launcher auto-hide behavior and the community here was kind and clever enough to give me exactly what I needed here. Now I wonder if there is ONE command ...
1
vote
3answers
68 views

How to write a script that generates a text file and opens it?

I have recently started using Linux and I want to create a script that will do the following: Generate a text file where the first line is: Work Plan {todays date} Save it with the name work_plan_{...
1
vote
0answers
47 views

Error Trying to install Teamspeak 3 client in Ubuntu 16.04: No such file or directory

Ok for starters: I'm running Ubuntu 16.04 LTS 64 bit. I downloaded TeamSpeak3-Client-linux_amd64-3.0.19.3.run Used the GUI to allow for executing the file as a program (I first tried changing it in ...
6
votes
2answers
167 views

command output redirection using '-< <( … )'

I needed to extract a shasum. This works, but can anyone explain why? sed 's/^.*= //' -< <(openssl dgst -sha256 filename) I'm familiar with the $( ) construct, but can't find docs for <( ),...
4
votes
0answers
53 views

How to catch the command failure events in ubuntu?

I am trying to execute the script whenever the command fails. We all know that if the command is failed $? value will not be equal to 0.It gives the value 127 if command fails. The script is ...
-5
votes
1answer
48 views

why did Ubuntu permit install bash on Windows? [closed]

Can you explain to me why Ubuntu permitted Windows have bash inside that OS? What is the reason you gave bash to Windows?
2
votes
0answers
37 views

How to use CTRL+HOME in the terminal?

When I use emacs in graphic mode, I can go to the beginning of the buffer with Ctrl+Home. When in bash, emacs won't recognize the combination and only sees the Home. I checked like here and, in ...
0
votes
1answer
24 views

How do I launch zathura from bash/emacs maximized / fullscreen?

I use recently discovered zathura and I like it a lot. I use it now to check the documents from emacs/AUCTeX like: (setq TeX-view-program-list '(("zathura" "zathura --page=%(outpage) %o"))) Which ...
1
vote
1answer
53 views

How to avoid password request for sudo for crontab scripts?

I need that a new user could execute sudo without any request of password, because this user has in crontab a .sh that uses sudo for some commands. I created a new user on my ubuntu server 16.04 x64 ...
0
votes
0answers
17 views

Screen br tightness script will not run in crontab

My laptop periodically turns on at full brightness, despite the previous setting. As a quick fix, I made the following script which works just fine if I run it manually: #!/bin/sh /usr/bin/...
2
votes
1answer
55 views

Unable to run a script from a text file

I have a simple script that I want to be able to run by double clicking a text file and having it run in terminal so i don't have to do it manually #!bin/bash $ cd /home/tyler/df_linux $ ./df I've ...
1
vote
1answer
24 views

Why my .bashrc has error?

I added this path to .bashrc file . export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 export HADOOP_INSTALL=/usr/local/hadoop export $PATH=$PATH:$HADOOP_INSTALL/bin export $PATH=$PATH:$...
2
votes
1answer
24 views

How can I view the output of a .sh file placed in rc.local?

I wrote a short script to run lampp's php script. It is residing on rc.local where I first run opt/lampp/lampp and then, run the sh (which is infinite) that is echoing to the output buffer infinitely. ...
7
votes
2answers
46 views

How to effectively navigate the Terminal and installed packages/commands?

I am an electrical & computer engineer that has recently started using Ubuntu 16.04 to modify an Android-based Computer on Module (COM) to suit the needs of a new product I am working on for the ...
2
votes
1answer
69 views

Controlling Ubuntu Gnome 16.04 screen lock with arduino

I am trying to use arduino with my laptop (Ubuntu-gnome 16.04 installed) to control the screen lock using RFID Module (Screen lock/unlock is controlled by an RFID card) Here in this particular case, ...
0
votes
1answer
17 views

Emscripten and em++ install question

I installed the latest emsdk_portable so I could use Emscripten, then I ran the following commands with no problem. $ ./emsdk update $ ./emsdk install latest Then, I went to run this command: ./...
4
votes
1answer
215 views

Run in terminal not working

I am new to Ubuntu and I was trying to run this script: #!/usr/bin/env bash echo hello world It works fine if I open the terminal first and manually invoke it. Like ./test. I have set "Ask each ...
0
votes
1answer
20 views

Shell script does not continue after openVPN command

I am trying to use a shell script to start an openVPN connection and mount a folder I can reach through that connection. (I don't know all too much about shell script). So I created this script: #!/...
0
votes
1answer
37 views

.sh to loop through folders recursive-

My file path is /server/2TB_HDD/TV Shows/ (inside this I have about 100 shows, each with seasons in them) The problem I seem to be having is the file path. "TV Shows" part. Similar problem if I run ...
1
vote
1answer
98 views

Bash : Syntax error near unexpected token '('

i am a beginner to Linux stuffs. Following some tutorial I used the following command, that split my zinc.mol2 into 1000 files named tmp. cat zinc.mol2 | csplit -ftmp -n4 -ks - '%^@.TRIPOS.MOLECULE%' ...
0
votes
0answers
32 views

How to install HBase on Ubuntu in a 4 node Hadoop cluster?

I have a running Hadoop 2.x cluster. Now I want to install HBase,and Zookeeper in fully distributed mode and use it. But, I have few doubts. I have Hadoop distributed cluster. Lets say I have 3 ...
3
votes
0answers
22 views

How do I make the bash terminal use my “home” custom Palette color scheme over an ssh connection?

There are colors when I ls when connected to the remote system using xterm-256color, but they are not the palette colors I have selected in my profile. I had this working before, but recently had to ...
2
votes
5answers
74 views

Shell Script source file not saved

I saved a shell script in bin(created by me). When I run the program, to avoid ./ to run the script I need to copy the script to one of the directories specified by PATH variable. The bin directory ...
3
votes
4answers
63 views

formatting with awk

I have this text: Core/Dev Core/master FrontEnd/Dev FrontEnd/DoubleClick FrontEnd/HEAD -> FrontEnd/master FrontEnd/master Infrastructure/Dev Infrastructure/master Software/Dev Software/Control ...
1
vote
2answers
53 views

How to copy files from multiple directories, adding the parent folder's name to the filename?

I have been looking to all possible answers about "copying file from multiple directories to one single directory" but I cannot find my answer. I need something slightly more specific for my database ...
1
vote
0answers
25 views

NoMachine script to automatically lock the screensaver when disconnecting not working

NoMachine provides this resource for adding a script to lock the system following a disconnect. However, this doesn't seem to work under any circumstances using any of the methods provided for any ...
1
vote
0answers
22 views

Autocomplete SSH bash: export: `-a': not a valid identifier

When I try to autocomplete using double TAB, I get this error: bash: export: `-a': not a valid identifier This mainly happens when trying to autocomplete ssh routes. However sometimes it fails to ...
2
votes
2answers
47 views

How to extract certain strings from hyperlink and create a folder with same string in bash?

I have a text file(web.txt) containing a long list of urls with this pattern http://www.example.com/ab1.htm http://www.example.com/ab2.htm http://www.example.com/bc1.htm http://www.example.com/qw3....
0
votes
0answers
9 views

Unicode issue when ssh'ing from GNOME Terminal to OS X [migrated]

When I ssh from GNOME Terminal (tried different 14.04/16.04 distros, currently on Mint 18) to OS X, I have a unicode issue, e.g. the prompt is not properly displayed. On OS X, I have bash 4.x as a ...
0
votes
1answer
17 views

Navigating/Exiting command line configuration screens from bash script

I'm new to bash scripting and making a initial setup script that I can run to quickly set up a new install. When installing ddclient sudo apt-get install ddclient -y it opens a command line ...
1
vote
1answer
41 views

Using source command to replace bash string with field array

I've programmed in other languages but bash and unix in general are very new to me. I think a bash wizard might see an obvious solution, using the source command to read in a settings file - and ...
0
votes
1answer
42 views

-bash: syntax error near unexpected token `&'

I get this error (-bash: syntax error near unexpected token `&' ) when I run the command below: sudochown -hRfwebadmin:www-data /web/<repertoire>&&sudoln -s /web/<...
4
votes
1answer
92 views

.sh script works in Terminal, but not when executed via “Run in Terminal”

I'm getting nuts with this... I want to be able to open the application "Jupyter Notebook" with a one line .sh script (that I have made executable) that simply says: jupyter notebook If I put this ...
0
votes
1answer
44 views

Installing NS2 under Ubuntu

I'm trying to install NS2 on Ubuntu 14.04. I followed the steps that are recommended and in this answer. But I'm still facing lots of errors. /home/smallko/ns-allinone-2.28/sgb/gb_io.w:576: undefined ...
1
vote
2answers
32 views

Save part of a terminal output

I am using Ubuntu to get the output from a BLE device, and in the terminal I get a continuous stream of values. The only problem is that they are preceded by a useless string (I'm reading ...
2
votes
2answers
22 views

Problems with floating arithmetic in bash

I have code in bash: a=$(cat "tempf.out") Where tempf.out is smth like this: -432.4319347412 I want to multyiply it by 2, so, I write: result=$(expr $a*2) But I get this: *232.4319347412 ...
1
vote
0answers
20 views

Pulse audio error module-echo-cancel.c not found

I am trying to activate echo cancel module . i added the line load-module module-echo-cancel But when i try to restart now the pulseAudio i get the error saying E: [pulseaudio] module-echo-cancel.c:...