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

learn more… | top users | synonyms (1)

1
vote
3answers
23 views

Bash script not recording

So, here i am, playing with some bash scripts, and there is something that doesn't work: #!/bin/bash script -c \ sudo apt-get update && sudo apt-get upgrade && exit echo "(Not ...
1
vote
0answers
13 views

script to concatenate multiple text files found in zip archives nested in multiple folders

I have 30 gig of text files and html files from various sources laying in a nested folder hierarchy. All these folders are in my home directory in a folder named zipFiles. The hierarchy is 20 levels ...
0
votes
0answers
6 views

Files selected using zenity --file-select are not added to “recents” shortcut

I'm using zenity to select input files for a lua script on the command-line. While using the GUI already saves time over the alternative of typing in really long filenames, I was hoping to save even ...
1
vote
1answer
27 views

How to close terminal from a bash script

I'm new on this forum and with Linux. I'm trying to make a simple script what will open a new terminal with a new name, and close the old terminal from where the script was running. The problem i ...
0
votes
0answers
11 views

sh script works manually but not via cron

so I have a cronjob created using this tutorial: http://www.matt-helps.com/automatic-backup-of-mysql-database-to-s3/ It runs when I give the command sudo sh s3BucketBackupScript.sh But I can't get ...
0
votes
0answers
9 views

Drop cache pages and memory (cleaning the cache) as normal user

Some times I need to clean the system cache by doing the steps below: sync su echo 3 > /proc/sys/vm/drop_caches as you can see, I need root privileges for this purpose. Is there any way to do ...
0
votes
0answers
26 views

Bash - for loop help needed please

So I have the below script and it works as expected (it SSH's to 40 hosts, goes to a specific file looks for a specific word with a date of yesterday, puts a . at the end of the line and then mails ...
0
votes
0answers
13 views

How do I use the mmv utility to move an arbitrary number of files?

I have a folder with too many files, I want to move some of the files to a subdirectory -- without a script. How can I move, or copy, not all files, but the only the first n number of files? For ...
2
votes
2answers
38 views

gnome-terminal starts with “grep: write error: Broken pipe” message

I am running Ubuntu 14.04.3, it's uptodate. I don't know why, for a few days I began to take grep: write error: Broken pipe message on launching gnome-terminal . It seems to be harmless but it bothers ...
0
votes
0answers
16 views

Can not run executable files from a mounted drive [on hold]

I have downloaded eclipse and rubymine and previously placed in home folder. Then I used to open both programs by double clicking on eclipse.sh and rubymine.sh. Now I moved these two folders in a ...
0
votes
1answer
16 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
25 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
42 views

How to put a date as one argument [on hold]

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
25 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
22 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
69 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
33 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
34 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
18 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
48 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
33 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
38 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
46 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
36 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
54 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
32 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
132 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
446 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
15 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. ...