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

learn more… | top users | synonyms (1)

0
votes
1answer
15 views

Bash script not working with crontab [on hold]

I own a raspberry pi that runs raspbian jessie. I'm using this raspberry with motioneye as a system surveillance. Motioneye records files to a sd card but i want to delete older files in folder ...
0
votes
0answers
21 views

How to improve bash scripting from 1 long line to a better method? [migrated]

I have a script that open up terminal and open up 5 tabs, execute a certain command, and go to a certain working directory. #!/bin/sh gnome-terminal --tab --title="Zookeeper" --profile Hold -e "sh ...
0
votes
0answers
17 views

How to autorun a ruby script in Ubuntu?

I'm using rvm and running ruby 2.3.0. which ruby returns /home/ubuntu/.rvm/rubies/ruby-2.3.0/bin/ruby The script location is: /home/redline/sinatra-aggregator/server.rb. I've tried all sorts of ...
-4
votes
0answers
36 views

How to put a date as one argument

I have a decryption program "ELF" that takes in a string as an argument and an encrypted text with a calendar image, when i try to input the encrypted text NXIS24CuEq@uEq@uEq@u into the program I just ...
2
votes
1answer
22 views

./run.sh: line 1: java: command not found

I'm trying to install worksnaps client so I can start working on a project. I'm running Ubuntu 14.04 LTS 32bit system. Installation and Configuration for worksnaps are simple : Download the ...
0
votes
1answer
21 views

Bash prompt after format of drives

I'm almost certain I formatted all my partitions to unallocated space, yet on an occasional reboot back to windows 10, I get thrown to a bash prompt. So I have to reboot and select windows boot ...
0
votes
0answers
67 views

Color coding the terminal with ANSI R,G,B

My question is where would be an appropriate place to share the below script? r=0 g=0 b=0 while : ; do for ((r=0;r<6;r++)); do color=$((16+36*r+6*g+b)); printf "\033[38;5; ...
0
votes
1answer
32 views

Why is rsync copying directory structure when my find result only shows me files?

I have an annoyingly complicated find command I've cobbled together that I pipe to rsync with the intention of copying files and syncing new versions. I'm trying to write something that is efficient ...
0
votes
2answers
31 views

How do I access my Bash History? [duplicate]

I am fairly new to Linux and I need to find a way to show the contents of my Bash History via the command line, and unfortunately I can't seem to find anything that works, or that I can understand. I ...
2
votes
2answers
15 views

Ubuntu/Linux + VeraCrypt + non-relative encrypted volume paths?

Can track of VeraCrypt volume be defined in absolute terms on Linux? Windows + VeraCrypt + encrypted volume absolute paths On Windows I can mount veracrypt encrypted partitions/disks via batch ...
1
vote
1answer
41 views

run startup script which requires a xserver session

I have a python3-script which uses the Gtk-module (imported from gi.repository, for recent-manager functionality), requiring a link to the current xserver session (lightdm service in Ubuntu). Running ...
0
votes
1answer
9 views

Unable to start a cron task as root

I use a program to check raid status. The command is megaclisas-status. Here is the issue : Has user /usr/sbin/megaclisas-status return : This script requires Administrator privs => OK Has root ...
0
votes
1answer
32 views

How to change command line prompt name and add path of current directory after name? [duplicate]

Currently my command line prompt looks like this nuve@nuve-Inspiron-5547:~$ but I want to change it Azer's Terminal:"Path of current directory". How can I do this? I need exact code line to add to ...
-1
votes
1answer
37 views

What's wrong with tee command?

I am running the following python script piped to tee command #!/usr/bin/python from sys import exit,exc_info from time import sleep try: print "hello" #raise KeyboardInterrupt ...
0
votes
1answer
30 views

Can't execute this file [on hold]

I can't execute the skype file. I have the permissions I need. What's the meaning of filename* in the ll output?
0
votes
1answer
17 views

How to make shell script restart Java if any thread crashes? [on hold]

I have a multi threaded Java program. Ideally it should run once and successfully terminate. Unfortunately, sometimes one of the threads crashes, such as by throwing DivisionByZeroException. Since ...
2
votes
2answers
136 views

Why do scripts ran via “sh *.sh” function differently than “./*.sh”? [duplicate]

I'm using Ubuntu 15.10. I have noticed a weird problem. When running a rsync command embedded in a shell script (as root) with --exclude={} options, rsync works and excludes paths as it's supposed ...
-1
votes
3answers
44 views

Extract info from file

Is there an efficient way to parse a file like: 2 41620 . T G 100 PASS ...
1
vote
0answers
15 views

Unable to locate package pnp4nagios

I'm having problems trying to find the pnp4nagios package. I don't know what to do. apt-get install pnp4nagios -y
1
vote
0answers
10 views

Shell script to create multiple accounts? [duplicate]

I'm looking for some help with a school project which needs a shell script to create 10 accounts (5 teaches and 5 students into different groups) along with respected passwords. I'm a true ubuntu noob ...
0
votes
0answers
35 views

Spelling mistake in ~/.bashrc

I am a newbie and I wanted actually install MeanJS but then I made the following mistake. I wanted to paste this in the terminal: echo 'export PATH=$HOME/.node/bin:$PATH' >> ~/.bashrc But ...
1
vote
2answers
52 views

Problem with using wildcards when I do CP command in Terminal

I am new and try to learning Terminal Command. Today I faced some problem with cp wildcard command option. I wrote in Terminal this command cp Downloads/[:alnum:] test/ Here, Downloads is the ...
0
votes
1answer
31 views

How do I write an output of one command into a file? [duplicate]

Let's say we got a content of the following command in bash, which consists of several rows, and just one column: tacmd listsystems | grep -i $i | awk '{print $1}' This content is a list of offline ...
3
votes
1answer
130 views

How do I show the git branch with colours in Bash prompt?

I am using this guide to show the branch name in gnome terminal (Ubuntu 15.10) when working in a git repository. Based on the above I now have the below in my ~/.bashrc file: # uncomment for a ...
1
vote
1answer
16 views

Cannot backup using Duplicity via cron

I am trying to run a backup script foo.sh via cron. The code is as follows: #!/bin/bash export PASSPHRASE=password123 duplicity ../learningbash file://../../../media/kingston unset PASSPHRASE Then ...
0
votes
1answer
15 views

How to check network usage over past X minutes

I have a media PC (that is also a web test server on the LAN) that I want to reboot every so often as long as it is not in use. I have tests in place for the server using kodi, myth etc (its the ...
0
votes
1answer
30 views

Why can't I explicitly source a file using su -c?

I'm trying to get su to source /home/ghost/.bashrc, but it doesn't seem to load the contents: $ su -l -c 'source /home/ghost/.bashrc; nvm' ghost -su: nvm: command not found I use nvm to manage Node ...
0
votes
0answers
17 views

How do I navigate between directories in terminal like zsh of oh-my-zsh by TAB navigation, but using bash?

I want know how do I navigate between directories in terminal like zsh of oh-my-zsh by TAB navigation, but using bash? I know oh-my-zsh, its directories navigation works perfectly via TAB completion, ...
0
votes
1answer
23 views

mariadb-server syntax error

I am writing a bash script and having trouble with $PASSWORD. Can anyone please tell me the correct way to write sql lines in bash script? QUERY="GRANT ALL PRIVILEGES ON db.* TO 'user'@'localhost' ...
0
votes
0answers
13 views

How do I find which serial port my Arduino is connected to with a shell script?

I'm writing a little script right now which sends some data to the Arduino through a bash shell script. The command that sends the data looks like this: alias led_green="echo -e -n '\x10' > ...
0
votes
1answer
22 views

Interpreting !12 as string and not as terminal history

Using the sample command below in curl, it doesn't work as expected: curl -ik "http://localhost/index.php?username=parto&password=hello!23" I expect the parameters to be passed to include: ...
-1
votes
1answer
27 views

Print a String on Its Own Place in Unix Shell [closed]

I'm trying to print contents of a text file(actually its strings). I'm familiar with some commands like grep, awk, sed; I forcibly want to echo string on its original place in file and I couldn't. You ...
7
votes
5answers
443 views

Bash - Check directory for files against list of partial file names

I have a server which receives a file per client each day into a directory. The filenames are constructed as follows: uuid_datestring_other-data For example: ...
0
votes
2answers
43 views

How do I change a variable of a background function?

I have been working on a script for my father that manages several tasks through a script with many functions that chain together (organization purposes). This script relies entirely on zenity for all ...
0
votes
0answers
14 views

Upstart Ruby version issue

I am trying to get Upstart to fire up Sidekiq (https://github.com/mperham/sidekiq/wiki/Deploying-to-Ubuntu). I can manually start it but the same command fails in the Upstart script. I have piped ...
0
votes
1answer
31 views

Bash script not running [duplicate]

So I'm pretty new to ubuntu and I'm trying to make a simple bash script that all it does is running Rubymine so I don't have to write it down in the command line everytime and also so I can have it on ...
0
votes
0answers
27 views

(standard_in) 1: parse error with bc

I am a new user bash. I want to divide two numbers, I used bc -l to take the decimals but I have this error: (standard_in) 1: parse error. This is my script: for res in {1..52} do cut ...
0
votes
1answer
17 views

No permission to write to serial device

Getting error "Permission denied" while writing to serial port from command line. I do : echo aaa > /dev/ttyS0 or even sudo echo aaa > /dev/ttyS0 but get the same result. How to solve this ...
0
votes
0answers
14 views

setpath in .sh script is not working [duplicate]

This is my .sh script. #!/bin/bash export PATH=$PATH:/home/srilm-1.7.1/bin When I am using this script file I could not add the environment variable path for temporary purpose(though the script is ...
3
votes
2answers
74 views

Can a Zenity list display a string `--option`?

Is it possible to have a Zenity list-style menu show a code option like -r? I am trying to make a simple GUI for an FFMPEG bash script. This is just one prompt for selecting a framerate for a video. ...
-1
votes
1answer
50 views

I can't use the ./ command in USB flash drive [duplicate]

I recently got Linux, and wanted to run the game dwarf fortress in my USB flash drive. To run dwarf fortress on Linux you have to use ./df in the dwarf fortress folder, but when I use this command it ...
0
votes
2answers
25 views

Save terminal output to variable in expect/tcl

Hej all, I have to use an interactive program and I want to automatize it with expect. My experiences in Linux and scripting is not the best. So this is the program output: enter minimum ...
0
votes
0answers
14 views

Shrink Terminal Prompt Path [duplicate]

This has crept up on me over the past many weeks to the point I am getting annoyed by this lengthy string as it gets in the way of reading the output messages. Here is what my Terminal looks like: ...
0
votes
0answers
17 views

Bash script: How to concatenate input parameters with strings? [duplicate]

I want to define an alias bak_log which uses an input parameter to backup all files starting with such string I can't find the way to concatenate the input parameter with other strings in order to ...
19
votes
4answers
3k views

Why does 'ls > ls.out' cause 'ls.out' to be included in list of names?

Why does $ ls > ls.out cause 'ls.out' to be included in list of names of files in current directory? Why was this chosen to be? Why not otherwise?
0
votes
3answers
54 views

How do i efficiently use environment variables?

I'm curious about learning about choosing correct env. variables. How to make out setting what env. variable would get the job done Example: if you want to make sure that command history always ...
0
votes
0answers
37 views

Bash script not working with shortcuts

My bash script is working flawless when i call from terminal. However, when i create shortcut to it acts weird. #!/bin/bash url="" function uploadImage { url="$(curl -s -F "file=@$1" ...
0
votes
1answer
23 views

Crontab isn't working with simple bash script

I am not quite sure what I am doing wrong. I am trying to create a cron job to run a bash script. The bash script will basically check my file (ip.address.txt), find my public ip address, then check ...
14
votes
1answer
1k views

What does this “printf” command do?

I was going through a tutorial and there I came across a command: printf "%(%s)T" The output of this command is: 1454299615 Could anybody please tell me what is this command and what the output ...
0
votes
0answers
39 views

Changing the color of root prompt in terminal [duplicate]

If I'm going to edit the bashrc file, where do I place the color codes to change the color of the root prompt (and not the normal prompt)? I already have the color for normal prompt changed. But when ...