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

learn more… | top users | synonyms (1)

1
vote
0answers
76 views

16.04 - MenuBar Clock Missing

Ok, so the clock in the top right corner of the menubar is going missing. Here's what I know: I'm on the 4/12/16 build of 16.04. The clock is present when I first install the OS. Even when it's gone ...
0
votes
0answers
33 views

Launching game (0AD) from the terminal

I was trying to play 0AD from my ubuntu box and was experimenting on launching the game via terminal. When running the bash command bash /usr/games/0ad it brings up an error regarding the video ...
0
votes
1answer
106 views

How to validate a user's password, with a shell script? [duplicate]

I'm making a bash script for the Ubuntu Terminal. I need to verify the user before the code can continue. How do I ask and validate their existing log-in password?
0
votes
1answer
411 views

Getting “Scheme missing” error with wget

I wrote a little script that grabs a random wallpaper from the Desktoppr API and changes my desktop wallpaper to it: #!/bin/bash url=$(curl 'https://api.desktoppr.co/1/wallpapers?page='$(shuf -i 1-...
1
vote
1answer
57 views

User add and shell script with password

I know how to use the useradd comand but would like to make a shell script to automate the process so how would I put the users input to the password part which is a dialog presented after I have ...
0
votes
2answers
120 views

How to get File Size in BASH with readable size not in bytes

Here is what i have in my shell file: FILENAME=/var/lib/backups/html-backup/backup-15-04-2016.tar.gz; FILESIZE= $(ls -lah $FILENAME | awk '{ $FILESIZEINGB = $5}') echo "Size is $FILESIZEINGB ." Can ...
0
votes
1answer
45 views

Concatenate find command with other commans

I am trying to index my file system. What I want to do, is: execute the command find, and for each entry save the last access time, last modified time, compute the hash and other operations. In order ...
9
votes
1answer
544 views

What are these extra output lines in bash?

It's for sometime that these lines can be seen after running a command (randomly): [1]- Done wget -c http://downloads.sourceforge.net/project/zorin-os/9/zorin-os-9-core-32.iso?r=...
0
votes
1answer
37 views

How can I keep track of all the packages / dependencies that are installed when I run apt-get for a specific package?

I am trying to write a script that runs in the background and keeps track of the packages I install manually with the apt-get command. For example - I open up a terminal and run sudo apt-get install ...
0
votes
2answers
44 views

crontab doesn't seem to work and makes different schedule in cron.d!

sudo crontab -e lets me edit the crontab, and I put in this: # Hourly backup 0 * * * * rsnapshot hourly # Daily backup 0 2 * * * rsnapshot daily # Weekly backup 0 4 * * 6 rsnapshot weekly And it ...
2
votes
1answer
45 views

Restore duplicity archive with entire path remembered

Lets say I have two files that I want to separately backup: /home/user1 and /home/user2/ This is easy: duplicity /home/user1 file:///media/mateusz/Backup/user1_backup duplicity /home/user2 file:///...
0
votes
0answers
20 views

Script to grab file which is downloaded automatically when site is visited

I need a script that would enable me to grab the file that is automatically downloaded when a particular site is visited. I have a PHP script that downloads a file once the link is entered. I need a ...
0
votes
1answer
184 views

Bash syntax error near unexpected token when trying to export

I'm trying to add these lines to ~/.bashrc (previously untouched): export NVM_DIR="/home/julian/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm export WORKON_HOME=$...
0
votes
2answers
57 views

Is there a “variable” to see if computer is in sleep mode?

Is there some variable in Ubuntu (14.04) that could be read in bash script to know in which mode the computer is (active/sleep/suspend)? If yes, is it possible to see also for how long is it current ...
2
votes
2answers
50 views

Is it possible to run more than one command in a someapp.desktop file? [duplicate]

i am just trying to find a way to run an extra command when opening an app (Firefox), but i am failing miserably... The original question is here. I tried to add my command after the app command as ...
0
votes
0answers
25 views

“Smart” update/upgrade script in bash

I have installed Ubuntu on my sisters computer. I know she will never touch the update icon. So I would like to make a script to perform update. But to disturb as little as possible, there are 2 more ...
1
vote
0answers
124 views

how to automatically copy new files from sd reader to disk on connect?

im new with ubuntu and linux, and poor knowleadge of english, sorry if i cant write clarely. I need a script or something to automatically move new photos (.cr2) from my camera's sd when i put it on ...
0
votes
2answers
43 views

exporting an environment variable from a bash script to a tcsh shell

I run bash scripts from tcsh shells. I want to set an environment variable in the tcsh shell from a bash script. The method of doing this, if your parent shell is bash is to source a file, i.e., ...
1
vote
1answer
473 views

Open terminal on startup and run command [duplicate]

Very simple question, I'm new to Linux I have a command run on startup (Elementary OS) command is: /home/zachary/Documents/Server108/Server108.sh When I turn my laptop on the command runs in the ...
0
votes
0answers
36 views

at command is not executed

I'm automating some mouse clicks using at and xdotool as follows: echo "./autocheckout" | at 18:00 where autocheckout is a bash script as follows: #!/bin/bash # Remember to see if Javascript is ...
-4
votes
1answer
34 views

Can i run bash script as statement in if loop?

My question is to run bash script in if loop like: if [ conditional expression ] then //here run .sh file// fi Is it possible?
1
vote
1answer
221 views

Cannot activate python virtual env in jenkins shell script

I have installed Jenkins on ubuntu 15.10. In a shell build step I am trying to create a Python virtual environment and activate it: But I get the following error when I run the job: /tmp/...
0
votes
0answers
14 views

Wireless switching on two VLAN

I have a question regarding how to switch between two VLAN using terminal commands. One is a wired connection which I use for an application that needs to be inside our intranet. The other is a ...
0
votes
1answer
40 views

Installed package, lsleases, giving bash “No such file or directory” error

I am trying to use, the following package, lsleases: https://github.com/j-keck/lsleases#usage I have tried installing using the deb package and also via the bintray.com repository, as detailed in ...
1
vote
1answer
68 views

sudo not found in shell of CTRL+ALT+F1

CTRL+ALT+F1 Login to shell Type any command: sudo, ls, cat Output: -bash sudo: No such file or directory Also when I login, environment variable is printed: -bash: export: '/home/some/path:...
1
vote
1answer
95 views

Command after apt-get install is not executing in script

I wrote a question on Server Fault, but I guess it's more applicable for this community. I'm writing a script which is meant to initially set up my Droplet. In the script, I'm opening SSH connection ...
-1
votes
1answer
38 views

“bash: … No such file or directory” returned for all files and directories!

I know there are similar questions but mine appears to be a different problem, as I get this error message for all files and directories that I try. I have been trying to install a very particular ...
0
votes
1answer
43 views

Permission denied when running “./script.sh”, but works when running “bash script.sh” [duplicate]

I've got an issue executing a simple .sh file Here is my example : I'm creating a simple "abc.sh" file for creating a folder echo 'mkdir abc' > abc.sh According the executable bit chmod +x ...
4
votes
1answer
39 views

How To Program A Bash Script That Presses A Certain Combination Of Keys?

Please, i need someone to help me in making a very simple bash script. The job of this script is just to press a certain combination of keys on the keyboard. My objective is to create a script that ...
3
votes
2answers
34 views

What's the difference between the keyboard shortcut commands and bash ones?

When I type in a terminal : gnome-screenshot -a -f /home/manuel/Desktop/"`date`".png I have the intended result, a file named "dimanche 10 avril 2016, 23:36:50 (UTC+0200).png" is created. However, ...
2
votes
5answers
163 views

How to exclude one specific file from being hashed through bash script

I actually try to run recursive through a folder structure and make md5sum on all files into a single md5checksums file. Heres my script: #!/bin/bash rm -f md5checksums find -type f -exec md5sum "{}...
0
votes
1answer
74 views

How does the new “Bash on windows 10” really work?

I read online that Ubuntu and bash are coming to windows 10. I also read that it's not an emulator or virtual machine running on top of windows, but something else. So how exactly does it all come ...
0
votes
2answers
47 views

Trouble with Shell Script cat | grep

#!/bin/bash mylanip=$(hostname -I | awk '{print $1}') touch /opt/portmapper/0prelims echo `java -jar /opt/portmapper/portmapper.jar -list | grep $mylanip > /opt/portmapper/0prelims` # HTTPS ...
0
votes
1answer
31 views

Zenity and bash

I have a broblem with bash script. I want to go back to menu but have an error from terminal "unexpected end of file" #!/bin/bash users=$(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) ...
0
votes
1answer
25 views

First Bash Script Problem

I'm completely new to Bash, and I'm trying to make a simple script to automate Git pulling and pushing from a repo, but I can't get it to work. Here is a pastebin of the code: http://pastebin.com/...
0
votes
0answers
18 views

Script no longer running at shutdown

Before having upgraded to Ubuntu 15.10, I was running 14.04, I had a script which remotely backed up the code from my web server, and stored it in a new folder. This worked by running at shutdown, ...
0
votes
0answers
30 views

bash: /etc/openvpn/server.conf: Permission denied [duplicate]

I want to run this command: gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz > /etc/openvpn/server.conf Instead I get the error message: bash: /etc/openvpn/server....
1
vote
1answer
49 views

Help - Command/Script to calculate WiFi speed and save

Hello to all the community Few days ago, I asked the community to help me create a script. #!/bin/bash date=$(date --iso-8601=seconds) printf 'TIME (s)\tSIGNAL STRENGTH (dBm)\t\tTxBITRATE (MBit/s)\...
1
vote
0answers
31 views

script command failing

I am trying to use script command in my script to record my session. But whenever I start it, it gets terminated at the same instant. home@ubuntu-box:~$ script /tmp/myfile.txt Script started, file ...
1
vote
1answer
16 views

Error when trying to copy directory content with rsync inside a shell script

I want to copy the content of "src/main/resources/" to my remote servers. This folder contains several *properties files. The following command executes without any problem in bash and zsh: rsync -...
3
votes
1answer
39 views

Coloring all output from terminal

Is there a way to make all the output of my terminal colored in a personalized way? e.g: If I issue the command: sudo apt-get update - I will get a column of text and what I want is a way to colorize ...
2
votes
1answer
46 views

How do I use variables and non-variables in a single sed command?

I'm trying to use sed to replace some PHP lines. My problem is I want to replace a line with PHP variables with a string including a Bash variable. Here is an example: sudo sed -i 's/$sUrl . $...
0
votes
1answer
44 views

List all environment variables, and show if they are exported or not

(This question is similar to this one and this one, but with the added requirement that I would like to know if variables are exported or not) I am in bash, Ubuntu 14.04.4 LTS. I would like to: ...
1
vote
0answers
45 views

Bash script to display XKCD comic - crontab not executing

I wrote a bash script to display the current xkcd comic in my web browser (using the RXKCD package in R). I want to schedule this so that the current xkcd comic displays every morning at 8am when I ...
2
votes
1answer
45 views

How to save the command line output to a file IN REALTIME

I have made a bash script that is designed to backup my PC every night around 4 o'clock. After the backup has finished, my system goes back into sleep. Currently I am using | tee -a $LOGFILE to log ...
-1
votes
1answer
43 views

How to run a command on remote host from a service? [closed]

I have a service in '/etc/init.d'. In that service, I run a command on a remote machine using ssh as a user. Currently I do this in the following way: sudo -u user bash -c "ssh user@172.21.6.70 '...
3
votes
1answer
91 views

alias nested string

I have an alias for youtube_dl which adds some arguments in my .bashrc file. I want to run this in a separate terminal similar to how it is done here. The problem is that this takes a string as input. ...
2
votes
3answers
243 views

String replacement with iterator

I have a file with a character I would like to replace, but I also want to have each instance of the character(s) to be replaced, be iterated with a number inside the sting replacement. SomeFile.txt ...
-1
votes
1answer
31 views

Purging custom .deb package through script exits suddenly

I am a developer, who sometime works on deployment related things. I am using Jenkins to auto-deploy my application to an ubuntu 14.04 machine. My application is packaged as .deb and some supporting ...
2
votes
1answer
44 views

How to delete multiple lines from txt file, based on a variable in previous column?

The idea is this: I have a document with data listed in the following way (shown below), and I want to delete any line that has a value of 70 or less in the 6th (last) column. On top of that, I want ...