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

learn more… | top users | synonyms (1)

1
vote
1answer
33 views

~/.inputrc is missed in ubuntu 14.04 => Cannot create a key binding

I want to add this key binding in the suitable conf file : Control-t: "top -Ss \C-m" Which means : Bind Ctrl+T keys to top -Ss command line . i enter on terminal sudo ls ~/.inputrc to check ...
0
votes
0answers
85 views

After exporting $PATH, commands don't work anymore

Trying installing Java, I tried to add it to the executable path with the line: export PATH=/usr/lib/jvm/jdk1.7.0_60/bin:$PATH in the system-wide /etc/bash.bashrc file. For some reason this ...
0
votes
0answers
36 views

Alias's in .bash* not working

I am trying to create an alias and it does not seem to be working. I have tried it with both .bashrc and .bash_aliases. If I open my terminal and perform source .bashrc, then they work OK. What am I ...
1
vote
1answer
44 views

Turn off/sleep after script completion

I have a little script. It's ripped out of a Youtube tutorial, untested, ugly, and not very good. It's not done and not intended for public use. Here it is: #!/bin/bash sudo apt-get -y install git ...
-2
votes
1answer
61 views

Store the return string to a variable from zenity

I am using Zenity tool to pop-up an entry dialog box. But how can i store the value entered into the text box to a variable ? Now, the string is being printed onto the console itself. I want it to be ...
0
votes
1answer
27 views

How to filter grep results?

I am new at writing scripts. So I am hoping this is simple. The script I am writing is used to gather system information and save it as an html file. When I run: sudo lshw -short it list all of ...
0
votes
1answer
34 views

Subshell in script wont print corectly

Why does my shell and subshell only print the first hour in my for loop? It's supposed to loop through all 24 hours in a day but only prints the first hour correctly. { for D in $(seq -f "%02g" 1 ...
2
votes
3answers
50 views

automate multiple file conversions

I need help fixing my script to automate multiple file conversions. I am working on the server and I am trying to find a way to convert files automatically. The conversion needs to be made through ...
1
vote
3answers
40 views

BASH: write the output of a command to a file

I run a program multible time using a bash script, and I want it's output to be written in a file. However, I couldn't make the operator ">filename.txt" work... Here is my script: for i in ...
1
vote
2answers
35 views

Echos, variables, and help with this question

The book Learning The Bash Shell says- "Notice that we used double quotes around variables (and strings containing them) in these echo examples. In Chapter 1, we said that some special characters ...
3
votes
4answers
274 views

Redirect an output to a file from command piping grep

I am running this: cat /dev/urandom|hexdump| grep -i "ffff f" > random and I get nothing in file random, it remains zero length after the command is interrupted. How to make it writing output ...
1
vote
3answers
60 views

script skipping user input in nested case statement

I am trying to create a nested case statement in which user input is expected (Y/N). However, the system never waits for the input and always goes to the third option, "Please answer yes or no". Can ...
1
vote
1answer
25 views

Adding multiple text lines with 'convert'

I'm trying to place multiple lines of text on an image, but the following produces the following error: convert convert: Non-conforming drawing primitive definition (\) [No such file or directory]. ...
2
votes
1answer
96 views

Automate Google Chrome installation on 14.04

Is there a way to completely automate Google Chrome installation on a new machine? I have the following commands working in a bash script: cd /tmp wget ...
1
vote
0answers
48 views

How can I draw selection rectangle on screen for my script?

I am trying to make a simple screencasting bash script. I want to get screen selection coordinates by drawing a red rectangle with mouse. I can use xdotools to get coordinates but how can I draw ...
0
votes
0answers
26 views

Issues with Grep

Why does the bottom line output "0" into the "AD-Results-$month-$Y" file? First grep command fgrep "$month $D $i:" $Filetmp > TempOutput Grep command to read "allows" from tail of ...
1
vote
1answer
52 views

bash : update apt-get only if apt cache is older than 10 minutes

I'm trying, with a script, to test if apt cache is older than 10 minutes old if [ "($(date +%s) - $(stat -c %Z /var/lib/apt/periodic/update-success-stamp)) -ge 600000" ]; then echo true fi But it ...
1
vote
1answer
28 views

how to test if the apt cache is up to date with bash

I'm searching a way to test in a bash script if a cache update is needed (to avoid unnecessary apt-get update when the apt-cache have been updated recently). can someone help me?
1
vote
1answer
28 views

Echo script arguments from function

I need to get script arguments within function with arguments. ./myscript 1 2 3 function_name () { if [ $1 == 3 ]; then # I need the $1 in the following echo to be the script argument, ...
0
votes
1answer
184 views

TangoWithDjango .bashrc edit causing errors

I'm currently doing the Tango with Django module and I've edited my .bashrc as it lists. Appending [[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc to the end ...
2
votes
1answer
55 views

Trying to use GNU Parallel with sed

Why does this line do nothing? I'm trying to run a "sed" command in parallel and it outputs nothing to "standard.txt" $Filetemp = the file I'm stream editing standard.txt = the file I'm outputting ...
0
votes
1answer
30 views

dconf change a string key

I'm trying to change a string based dconf key with a bash script, using the following command line: dconf write /org/gnome/nautilus/preferences/show-directory-item-counts 'never' But it return the ...
2
votes
1answer
58 views

Why is my cron script to dump a MySQL database not executed?

I have the following cron job: * * * * * /home/db_backups/test.sh which runs fine and is executed every minute. If I check with sudo grep \(CRON\) /var/log/syslog I get the following: Jun 23 ...
0
votes
2answers
93 views

Lilypond install not working

I'm trying to install Lilypond on a 32-bit system, and for some reason the sh file simply does not want to execute itself. I'm completely new to Ubuntu, so I have next to no knowledge of how anything ...
-5
votes
5answers
76 views

List hidden files without using - ( * | [closed]

Is it possible to list hidden files without using the characters mentioned above? This means not using any options or the * wildcard as well as some other characters (e.g this is not allowed "ls -a", ...
0
votes
0answers
23 views

<Enter> button does not work in Guake for zsh

I have 2 machines with Ubuntu 14.04 on them. On both machines I've tried to switch shell to zsh for Guake. As a result pressing button (to run a command) has no effect, although other ...
0
votes
1answer
49 views

Ubuntu 14 - unable to use sudo echo to overwrite files [duplicate]

For ubuntu 12.04 bash scripts, I used to be able to run commands like the example below to overwrite files: sudo echo 'line1 line2 line3' > /etc/some/config/file.conf Ever since Ubuntu 14.04, ...
2
votes
2answers
250 views

Unexpected end of file

Can someone explain why the end of the file is unexpected on line 49? (Line 49 is one line after the last line) #!/bin/bash timeend=$(date -u +%H%M) timestart=$(date --date "$timeend 30 minutes ...
1
vote
2answers
73 views

How to use -exec option in find command

I wanna solve some problems in compiz with my brain and hands. By the way I entered following command to build compiz from source in Ubuntu 12.04 find /opt/compiz-built/share/gconf/schemas -exec ...
1
vote
3answers
67 views

Print only the first match once

I have a code snippet that I am using to parse through a log file and print information I need. for i in $(cat ~/jlog/"$2"); do grep "$1" ~/jlog/"$2" | awk '/\([a-zA-Z0-9.]+/ {print ...
0
votes
1answer
29 views

Is there other way to get your DISPLAY env without using shell?

I have a script that will get executed by incrond when it sees changes in a watch dir. There is only a few env vars that are available in the script, the rest get cleared by incrond. So this becomes a ...
0
votes
1answer
40 views

Can someone explain what this grep/cut/awk command is doing

This is inside of a .sh script file: cd /somefolder IP=$(ifconfig | grep 'inet addr:'| grep 168 | grep 192|cut -d: -f2 | awk '{print $1}') The /somefolder has another folder list with a single ...
0
votes
2answers
47 views

Regular expression

I have a code that is looking for a specific pattern in my log files. Usually it begins with Association ID = (This is what I am looking for in parenthesis). Now the code I have made so far is ...
2
votes
2answers
109 views

Shell Scripting Function question

I have this code snippet I am working on for a small project I am doing: echo "Please enter SUID: "; read $uid uid_Assoc(){ arg1=$1 echo $1; } uid_Assoc Now to start, I would like ...
4
votes
3answers
363 views

Bash / Python error handling?

I am trying to execute very basic Python code containing error handling as a Bash script, but while the code seems to run OK in Python, the code generates problems when executed under Bash. ...
1
vote
1answer
446 views

Error Password: chsh: PAM: Authentication failure when try to install Oh my zsh

I try to install Oh my zsh. After install zsh (sudo apt-get update && sudo apt-get install -y zsh) Then I install sudo apt-get install -y curl then install git. the problems occurs ...
2
votes
1answer
45 views

Need to exec $SHELL on new terminal for settings to work

Unsure what is interfering with my shell, on every new shell I need to exec $SHELL to get correct settings to take. I am getting this prompt by default sayth@sayth-TravelMate-5740G:~$ and after ...
3
votes
2answers
227 views

Equivalent to command prompt's “tree” command? [duplicate]

Back in my (sucky) Windows days, I used the tree command to view the file hierarchy in a pretty display. I am aware of the find command, but to actually process any data in my clogged 241,416 ...
1
vote
4answers
74 views

Change directory structure from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY

I need to change my directory structure for my photos from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY I know this can sort of be done with exiftool, but it will only work on files containing EXIF-tags, and ...
0
votes
2answers
75 views

Speed up script

Which shell command is the fastest way to parse through millions of lines of text. Currently I'm using GREP in my script but it takes hours upon hours to finish. Sample Input: May 1 2014 00:00:00 ...
0
votes
0answers
30 views

get cpu usage of system users

Working with monit I need create an alert that get cpu usage of system users, so: top -b -n 1 -u user1 | awk 'NR>7 { sum += $9; } END { print sum; }' seems a good solution but I'm not sure about ...
0
votes
0answers
30 views

getting error in opening py file [duplicate]

I'm installing a software in Ubuntu 12.04 and got the following error: http://paste.ubuntu.com/7638369/ server@ubuntu:~/Desktop/revkit-1.3$ ./tools/gui/gui.py Traceback (most recent call last): ...
2
votes
1answer
21 views

Bash command completion of command parameters

In Fedora 21, we can type: apt-get ins hit tab, and it will complete the word install We are using an instance of Ubuntu 10.04 on a cloud platform, and tab completion works for files, but does not ...
0
votes
0answers
76 views

Grub rescue error: file not found after fsck and a few updates

I am new to Ubuntu. I was using Ubuntu 12.04 LTS. I ran a sudo fsck on my terminal and went on pressing y for a long time at the prompts that appeared. When it seemed to continue for long, I did a ...
1
vote
2answers
47 views

View thousands of pdf files one after another from a list

I have taken up a task of manually generating Library essential data from huge pdf library; what I want is: use a script with file names, to open a pdf file instance, review it and after I close ...
0
votes
0answers
693 views

GNU GRUB version 2.02 beta 2-9

I attempted to load Windows 8 and Ubuntu alongside each other and it was working well until my Ubuntu installation completed and I restarted the computer. Now I can't get past this error: ⠀Minimal ...
0
votes
0answers
34 views

Terminal exits program before able to accept Hashcat EULA

I'm trying to play around with hashcat,just using the examples included with the program, but before the command can run it requires me to accept the EULA. Instead of me being able to enter 'YES', the ...
1
vote
1answer
28 views

Translating to Bash Command

So for a project for school I had to install the DPJ extension to the Java language. I downloaded and unpacked a tarball containing the files, and then was told to run the following: setenv DPJ_ROOT ...
3
votes
5answers
299 views

Removing specific part of filename (what's after the second dash) for all files in a folder

I use the command line utility youtube-dl to download videos from YouTube and make mp3s from them with avconv. I'm doing this under Ubuntu 14.04 and very happy with it. The utility downloads the ...
4
votes
1answer
228 views

Why my 'at' clause command execute the shell immediately and ignored the time limit?

I wrote a shell named t.sh It's content is: touch 88888 The command I'm using is sh t.sh | at 03:13Jun15 After I execute this command, I got this show on my screen: warning: commands will be ...