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

learn more… | top users | synonyms (1)

0
votes
1answer
50 views

Double Quotes inside Double Quotes problem for postgres sensitive database name priviliges

Having a database with case sensitive name like MyDb, if I want to use psql to grant all privileges on this database to the user 'user' I can just write: GRANT ALL PRIVILEGES ON DATABASE "MyDb" TO ...
4
votes
5answers
652 views

How can I minimise the code needed to run this custom function?

I'd like to shorten one of my scripts and I got na idea but I dont know how to do that. Have a piece of code like this: COMMAND="find /etc -type " case $1: "directory") $COMMAND d ;; esac Of ...
0
votes
1answer
2k views

SSH script password input [closed]

So I am running Linux Mint 17.2. I have a bash file I would like to run in terminal to login via SSH into my other mint 17.2 server. I am able to do this manually no problem, but when I try using ...
3
votes
2answers
353 views

MRTG installation on Ubuntu and monitoring RPI

I have been trying to install MRTG on Ubuntu (VMware Workstation) by following the instructions on this website: https://help.ubuntu.com/community/MRTG. However, whenever I reach this point of ...
0
votes
0answers
53 views

script bash to move file with multiple extension

#!/bin/bash # #Directory MOVETO=/DRIVE/new2/ SOURCE=/DRIVE/picture/ #files to find MOVEFILES=("*.m4v" "*.avi" "*.art" "*.3gp" "*.mpeg") find "$SOURCE" -iname "${MOVEFILES}" -type f -exec mv -v ...
0
votes
1answer
46 views

sleep X - won't actually make bash script loop wait

I need to run this really simple script to serve my purpose: #!/bin/bash while [ 1 ]; do xdotool mousemove 2980 690 click 1 & sleep 14 done it's to make Xsane (scanner lamp) scan every ...
0
votes
0answers
17 views

How to have preset organization of existing windows?

I have a computer linked to a test bed and every time we want to run a test we open all our programs and have to organize them by dragging the windows.I was wondering if there was a way of making a ...
0
votes
1answer
49 views

Get back default /bin/bash

After installing virtualbox + few upgrades I found that I have no longer my default bash, but now I have (probably) xterm. (there was also problem with unity, but I coped with it). I can not execute ...
1
vote
1answer
1k views

Sudo android return “sudo: android: command not found”

I use Ubuntu 15.04 - Gnome, For any reason when I try to execute the function "Android" its return bash: /opt/android-sdk-linux/tools/android: Permission denied and when I type sudo android the ...
0
votes
1answer
518 views

Syntax error: EOF in backquote substitution

I scheduled following cron job: root@alexus:~# crontab -l | grep ^\@hourly @hourly OUT=`/usr/lib/nagios/plugins/check_disk --include-type=ext4 --warning=10% --critical=5%` ; if [ $? != 0 ] ; then ...
6
votes
4answers
351 views

is there ls -l numeric formating?

consider the output of this ls -l command: $ ls -l /usr/bin | tail -rwxr-xr-x 1 root root 105696 Oct 25 2014 zenity -rwxr-xr-x 1 root root 188296 Oct 21 2013 zip -rwxr-xr-x 1 root root ...
1
vote
1answer
94 views

Watch command does not work anymore

I used linux command watch sensors to watch my sensors before. However I have installed many packages and now watch command watches for changes in current directory. How can I run watch sensors as ...
1
vote
1answer
101 views

Direct script execution on Ubuntu Server 15.10 skipping login screen

I need to execute script automatically on boot and display its output on screen but I have two problems. Ubuntu asks login credentials How do I get script display output on screen (to work as in ...
1
vote
1answer
48 views

lowercase “a” not working in gnome-terminal but works in xterm?

I'm hesitant to even post this question as I'm sure it must be something simple but looking around I can't see how gnome-terminal would remap keys where xterm and a "real" terminal (ctrl+atl+F1) would ...
1
vote
2answers
57 views

Putting some lines in a script to execute them in gdb

I want to create a script or actually a shortcut to surf in peace #!/bin/bash konsole -e firefox --debug (gdb) handle SIGPIPE noprint nostop pass (gdb) handle SIGSEGV noprint nostop pass (gdb) run ...
0
votes
0answers
27 views

set classpath for www-data

I am using shell_exec() from PHP to run a Java program on Ubuntu. I tested the programs from terminal and its working perfectly. I think that my problem is that when i use shell_exec() the user is ...
10
votes
4answers
1k views

grep command and [ ]

I'm learning bash code and today I'm studying the command grep. if I run $ ps -fU user | grep thunderbird terminal shows: user 17410 1 0 10:09 ? 00:00:20 ...
0
votes
1answer
605 views

Why is grep only returning one line?

#!/bin/bash while true; do trap break SIGINT ping -w 5 10.0.0.1 | { trap '' SIGQUIT ts '%Y-%m-%d %H:%M:%S |' | grep -E 'PING|packets|rtt' | { read grep_out echo ...
1
vote
1answer
83 views

Blender GPU rendering works from command line but not in crontab [duplicate]

I would like to schedule blender renderings with GPU support. I have created a bash file rendering.sh to do the job. I have scheduled it with sudo crontab -e. * * * * * sleep 0 ; sudo ...
1
vote
1answer
318 views

How to script ssh-keygen with no password

I need to generate vagrant images that are configured as master/slave types. The slaves need to have SSH access to the master node, and there will be tens of thousands of slave instances. Vagrant ...
0
votes
1answer
61 views

Daily Cron job not executing

I created the following cron job under /etc/cron.daily/backup-vivashost #!/bin/bash DATE=`date +%Y%m%d` mkdir /var/lib/html-backup/www-$DATE/ cp -R /var/www/html/* ...
1
vote
1answer
52 views

Command cd stoped to work in Ubuntu 13.04

On a regular basis I change to Desktop using the command cd in a Terminal. But from a few days ago when I use the command cd in a Terminal to change to Desktop, like the following line: cd ...
1
vote
1answer
77 views

trouble installing qpdf 5.1.3; unable to infer tagged configuration

I'm trying to install qpdf 5.1.3. The default Ubuntu version is 5.1.1. (I have Ubuntu 14.04.3) After a few tries (I did what was written here: trouble installing qpdf 5.1.3), the end of the output ...
0
votes
1answer
221 views

I've broken command not found?

I was messing around with bower, npm, and node, as I was trying to upgrade ember-cli, and I broke something strange. I get the following python error whenever I type a command that is not found in ...
0
votes
1answer
49 views

Permissions needed by dircolors

I'm trying to use a custom ~/.dir_colors file to set custom terminal colors. I've got the eval in my .bashrc file and everything, but when dircolors is used with the file option, it does not change ...
0
votes
1answer
94 views

Run script on start-up before specific network card is initialized

I have a system with multiple network cards. How can I run a shell script before a specific network card is initialized on start-up? I am running Ubuntu 15.10.
7
votes
3answers
316 views

how to 'not' execute alias [duplicate]

I have set few aliases in .bashrc file. I need those aliases most of the time, but sometimes I need to run those command without options set in that particular alias. How to not execute alias ...
0
votes
0answers
19 views

Replace missing desktop files

I read through this and tried this code : desktop-file-validate /usr/share/applications/*.desktop. I got a very long list of errors. How do I replace all this files? I ask this because of my post ...
0
votes
1answer
16 views

Move back files

Tried to find out what was wrong with Unity, then I did this: mv backup_local/ .local/share/applications/ instead of mv backup_local/*.desktop .local/share/applications/. How do I fix this?
0
votes
1answer
111 views

is there a command to turn on keyboard lights?

I just updated the BIOS of my friend's Dell Latitude E6420 (from A08 to A22) and found out that the keyboard has a back light! There is a FN+Key which toggles thought the scales of brightness, maybe ...
1
vote
1answer
47 views

PowerShell “get-command *services*” equivalent with Terminal?

I’m new to the Terminal and would like to know if there’s a way to find certain command names within the terminal instead of trying to look them up online and through various sites. I’m enjoying the ...
1
vote
1answer
80 views

Change shell script file access permissions (chmod) from itself

Is it possible to change shell (Bash) script file access permissions (chmod) from itself ? for example if i have file named myScript.sh , can write into the file : chmod 777 myScript.sh ? and run ...
1
vote
2answers
134 views

How to run a python script as sudo by double-clicking it?

Simply put, how can I do this, providing a graphical prompt? I tried creating a separate bash script that when opened, ran the Python script with super-user permissions - I used gksu -u root ...
0
votes
0answers
10 views

Create and run alias file for command line [duplicate]

I have created a file "~/.aliases" file with the content: # git stuff alias ga="git add" alias gaa="git add ." in "~/.bashrc" at the top I have this code. # ~/.bashrc: executed by bash(1) for ...
0
votes
1answer
61 views

How to `echo` a variable declared / initialized in another function in a shell script?

Run this in Ubuntu 14.04.1: ./script.sh MyVM take Why does the echo line in the function list_snapshot work (it prints the value of those 3 variables) but the echo line in take_snapshot can't print ...
0
votes
2answers
306 views

convert animated gifs to sprite sheets

I have a shell scripting request, I haven’t spent much time figuring it out myself yet, but I want to try and convert animated gifs into sprite sheets for use in SDL game development. I know how to ...
0
votes
1answer
98 views

Concatenate multiple commands and write them in one line to a log file

I'm really new to Linux/Ubuntu. I want to log multiple information out of a bash script to a log file, for example the systems current timestamp, some text, and the systems hostname. I tried something ...
3
votes
1answer
70 views

Log error of script to a file along with the date and time

I can use 2> errorLogFile to log error of running script to a file right? my question is how to log the date and time of error along with error? for example: $ cat myScript 2> errorLogFile ...
0
votes
3answers
42 views

Shell script not recognizing JAVA_HOME env variable

gandalf@AS426:~$ gandalf@AS426:~$ cd /xnc gandalf@AS426:/xnc$ sudo ./runxnc.sh [sudo] password for gandalf: Need to set JAVA_HOME environment variable gandalf@AS426:/xnc$ echo $JAVA_HOME ...
1
vote
1answer
63 views

Bash al (alias local) function not found [closed]

Can I have bash aliases local to directory? Given such directory structure: dir1/ - . - .. - dir2/ - file When I cd dir1 alias eg do not work, but when I cd dir1/dir2/ such alias works. ...
0
votes
1answer
146 views

Keyboard shortcut for shell script in 15.10

For a while now I have been assigning some of my personal shell scripts to keyboard shortcuts in Ubuntu (by going through Settings > Keyboard > Shortcuts and assigning them under Custom). After ...
2
votes
1answer
69 views

Python os.getlogin() vs BASH : who

I have formed 3 sessions with user accounts and I got no problem with Unix: who command but why I am unable to get correct response with python : getoslogin() function. Please find attached image for ...
5
votes
1answer
149 views

How to sort audio files according to their cut-off frequency (real bitrate) in kHz?

I have some music collection and I want to sort/filter them easily according to their cut-off frequency (real bitrate, usually in kHz. I used to use Spek for showing me this information, but Spek ...
0
votes
0answers
216 views

Installing Wofram Mathematica 10.3 on Ubuntu 14.04 - error code 126

I am trying to install Mathematica 10.3.0 on Ubuntu 14.04 in a command line. Mathematica came as a shell script. Upon running it, I got the following output: sudo bash Mathematica_10.3.0_LINUX.sh ...
1
vote
1answer
146 views

How To Create A Startup Script To Run Both Grunt Watch and XAMPP

I'm new to Linux and Ubuntu and I'm a web developer. I created this small script to run Grunt watch and XAMPP at the same time. #!/bin/bash sudo /opt/lampp/lampp start cd ...
1
vote
2answers
162 views

Why does my script return a syntax error?

I wrote this script, but I don't know why I have a syntax error: #!/bin/bash echo Indica la fecha de hoy en formato dd-mm-aaaa read date echo Indica la hora actual en formato hh-mm ...
2
votes
3answers
54 views

My own variable for long paths

I'm writing some backup script and target path is pretty long. Could I define something like this? TARGET='/media/user/externaldrive/folder with spaces/blahblah' And then use it like this as part ...
2
votes
1answer
64 views

Create folder loop function doesn't work

I have created a function in a .sh file that creates directories in a loop with 3 parameters int: start, end and folder name name But I am getting the following error: Syntax error: "(" unexpected ...
2
votes
2answers
54 views

I deleted my desktop and everything froze. What did I do?

So I was playing around with a live disk experiment (using an external HHD as a live disk) and I made a script that made 9,023 directories on my desktop before I could stop it. Being the noob I am I ...
0
votes
1answer
116 views

monitor network status for systemd script

I am writing a service script under systemd which logs bandwidth usage every 1 hour. If the network goes down, something should tell this script that network is down and the script will stop ...