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

learn more… | top users | synonyms (1)

1
vote
1answer
70 views

Tv series and Bash-scripting

I've just downloaded a tv series season and the subtitles. If .mp4 and .srt files have the same name vlc automatically add them to the videos. The only thing in common they have is the number of the ...
9
votes
2answers
1k views

CPU temperature embedded in Bash command prompt

I was wondering if it would be possible to obtain the CPU temperature and embed it into the command prompt. This is my output for sensors: $}-sensors coretemp-isa-0000 Adapter: ISA adapter Physical ...
10
votes
3answers
22k views

How can I direct a pipe input to ls command?

When I type something like: find . -name *foo* | ls -lah it returns the same result as a plain ls command, as though it had no input. However: ls -lah $( find . -name *foo* ) works well, but ...
2
votes
1answer
2k views

Checking for a file and whether it is readable and writable

I'm trying to write a script that will look for a certain .txt file saved to my desktop. I want the script to be able to check if this file exists and then check to see if it is readable and ...
5
votes
4answers
754 views

renaming folders using a .txt file

I'm working in my terminal using bash trying to rename the folders: 1 2 3 4 5 I'd like to rename them according to a.txt file: a 2 c 3 d 5 e 1 b 4 The order in the .txt file is completely ...
0
votes
1answer
18 views

Loop trough all folders recursively end execute make command when Makefile present

I really suck in bash scripting, so i'm hoping on your help guys. I need a script which will loop trough all folders, sub folders, sub sub folders, etc. inside folder /home/work and if there is ...
0
votes
2answers
18 views

Messed with my /etc/profile and now an error pops up every time I log in

I am fairly new to Ubuntu, and did a little more messing around than I should have. I was reading a guide on downloading the Oracle 8 JDK and it said to change the last few lines of the /etc/profile ...
0
votes
0answers
14 views

How to make oh-my-zsh recommend uninstalled packages like bash?

I want zsh to recommend packages to install if I insert a command whose package is not installed like in Bash. Like
0
votes
1answer
28 views

How to run bash script only if passed a day? [duplicate]

I'd like to run my script often (not by cron but manually) but some slow parts like apt-get update && apt-get -y upgrade should be run max once per day. I think to save last execution time in ...
-1
votes
1answer
18 views

Complex bash output

I have this: cat ../out/output.out | grep E\(X\) >> res It generate file looks like: E(X) 1.2 E(X) 4.5 ...etc... It writes the row with "E(X)" in file res. In fact, it is value of ...
7
votes
4answers
655 views

How to write a script which works with or without arguments?

I have a bash script which goes something like this: #!/bin/bash if [ $1 = "--test" ] || [ $1 = "-t" ]; then echo "Testing..." testing="y" else testing="n" echo "Not testing." fi ...
10
votes
4answers
248 views

Shell with better editing capabilities

Shells (at least what I know) have really bad command editing capabilities. For example: I can't point the cursor to any point of the command. I can't select and backspace/delete/replace text in ...
8
votes
5answers
534 views

How to detect the number of opened terminals by the user

I am using Ubuntu and can manually change the bash shell prompt color to green using export PS1="\e[0;32m[\u@\h \W]\$ \e[m" However, I want the shell prompt color to automatically change whenever ...
2
votes
0answers
23 views

How to find the last valid information possibly spread over several log files

I have a fleet of busses that send me a monitoring log file every morning regarding the status of the vehicle the previous day. The log updates various information every 5 minutes. Among the data ...
0
votes
2answers
21 views

Run a command for all directories [duplicate]

I have a lot of directories that contain some text files and I would copy all files (of all directories) in a new directory. I'm looking for a bash command that do this. How can I do it?
7
votes
2answers
164 views

Timestamp in Exec= line of .desktop file possible?

Lubuntu 16.04 - Openbox session I can use the terminal to open a time-stamped file with gedit: gedit ~/$(date +%Y%m%d%H%M%S).txt The command can also be used via a keyboard shortcut in Openbox. ...
0
votes
1answer
17 views

Emacs suspends right after starting in bash

(Possibly) important info: Ubuntu version - 16.04 LTS GNU Emacs version - 24.5.1 GNU bash version - 4.3.42(1)-release I'm trying to edit my apache2.conf file in /etc/apache2/, but using sudo emacs ...
0
votes
1answer
36 views

I'm getting this whenever I open terminal

How do I fix it :/ declare -x CLUTTER_IM_MODULE="xim" declare -x CMAKE_PREFIX_PATH="/home/ahmed/catkin_ws/devel:/opt/ros/indigo" declare -x COLORTERM="gnome-terminal" declare -x ...
0
votes
0answers
7 views

Cannot start sqlplus on my dell inspiron15R tried every solution on askubuntu

I have followed the tutorial given at Oracle Instant Client sqlplus: error while loading shared libraries: libclntsh.so.12.1: cannot open shared object file: No such file or directory my ...
0
votes
1answer
19 views

Running two scripts on profile login (bash & sudo bash)

I have two scripts which I would like to be run when I log into my profile. ~/.scripts/startup/user-sensei-raw-startup.sh: ids=$(xinput list | awk '/SteelSeries Sensei Raw Gaming Mouse .*pointer/ ...
0
votes
0answers
48 views

$PATH problem in 16.04 “WARNING: your PATH doesn't contain …”

I use ubuntu 16.04 and trying to install a simulator (Omnet++). When I try and configure, it gives the below warning: WARNING: your PATH doesn't contain /home/aboubakar/omnetpp-5.0/bin! Add the ...
0
votes
0answers
10 views

Why doesn't Ubuntu/Debian package upstream loadable bash builtins ($bash_src/examples/loadables)

There's a bash-builtins package, but it only comes with sources and headers. The sources go to /usr/share/doc/bash-builtins/examples/loadables/ (for some strange reason), and they don't even compile. ...
0
votes
1answer
24 views

Why won't bash files run in Ubuntu? [duplicate]

I am running Ubuntu Desktop (so, there's the graphical interface that I'm using). When I double click a '.sh' file, I was expecting it to run. However, it opened up gedit instead. I enabled the ...
1
vote
0answers
46 views

have: command not found

Whenever I open up my bash and login into a sub-shell I get the following error -bash: have: command not found -bash: have: command not found -bash: have: command not found -bash: have: command not ...
1
vote
1answer
20 views

Unable to run docker-machine despite trying to add path

I downloaded the docker toolkit from docker. I tried to change the .basrc, .profile, .bash_profile, /etc/environment file by adding /usr/local/bin/ or /usr/local/bin/docker-machine but I am still not ...
1
vote
2answers
60 views

Problems embedding a command in Bash PS1

Hi all I am having problems trying to embed this command in my bash prompt so that it will update itself each time the prompt is shown. I would like it to be part of the prompt itself free -m | tr -s ...
1
vote
1answer
25 views

How to Integrate Dropbox in Thunar?

How can I integrate Dropbox into Thunar? I am using Xubuntu 14.04 with Xfce 4.12 installed via PPA, and thunar-dropbox-plugin has been broken. I have also heard that it is not working on Xubuntu ...
0
votes
0answers
25 views

Custom script not working as expected in ubuntu [duplicate]

I wrote a java application, want to register it as a service, so wrote a bash script in /etc/init.d/. Here is the script: #!/bin/sh # # chkconfig: 345 50 83 # ### BEGIN INIT INFO # Short ...
0
votes
0answers
29 views

Crontab - export DISPLAY=:0.0 or .sh script won't run

I have written a basic script to familiarize myself with crontab that changes my wallpaper every minute with one random image from a set folder: #! /bin/bash ...
0
votes
1answer
17 views

Python script in CRON is not running in AWS ubuntu 14.04 instance

I want to schedule a CRON job into AWS Ubuntu instance. I have a simple cron sample like the following - import pandas as greatPanda import pprint import uuid df = ...
1
vote
3answers
124 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 ...
3
votes
0answers
58 views

Bash Script Works On Command Line but not at startup

Let me ask this another way: There are at least (2) ways to have a bash script called automatically when a user connects to OpenVPN: Placing the script in the /etc/network/if-up.d folder Renaming ...
7
votes
1answer
749 views

What are the differences between executing shell scripts using “source file.sh”, “./file.sh”, “sh file.sh”, “. ./file.sh”?

Have a look at the code: #!/bin/bash read -p "Eneter 1 for UID and 2 for LOGNAME" choice if [ $choice -eq 1 ] then read -p "Enter UID: " uid logname=`cat /etc/passwd | grep $uid | ...
0
votes
1answer
9k views

when building u-boot /bin/bash: arm-none-linux-gnueabi-gcc: command not found

I am currently running Ubuntu 12.0.4 on a 64 bit machine. I have an AM335X development board. Along with the kit came the compressed kernel (linux 3,2), rootfs, u-boot, and ARM cross compiler ...
1
vote
1answer
91 views

How to change Terminal Title in ubuntu 16.04

When I was using ubuntu 14.04, it's easy to set title. Just press F2 or move mouse to top menu. But there is no menu on ubuntu 16.04 and press F2 can't change the title. What should I do?
0
votes
0answers
11 views

Can i download Transmission-Qt Win to windows? [closed]

Can i download Transmission-Qt Win to windows ? Now when it support Bash to latest win 10 ?
1
vote
1answer
135 views

unexpected EOF on the last and next to last line while creating alias

I am creating alias in .bash_aliases file in Ubuntu 14.04 with reference of this article I write these alias agi='sudo apt-get install' alias upd8='sudo apt-get update' alias perms='stat -c '%a - ...
1
vote
1answer
585 views

Error message when open terminal

This appears when I open the terminal: bash: export: `=': not valid name bash: export: `/home/(my account ...
0
votes
0answers
20 views

howto show all packets with a certain dependency [duplicate]

i want to find out which packets link to openssl on my system. what would be the bash command to get that information. i know that using ldd /path/to/file i can see what links to a certain binary or ...
-1
votes
1answer
19 views

Survival of manually edited variables

I have some environmental variables set in my .profile, and thus the variables can be set automatically when I log in. In some special cases, I also need to change some settings using the command ...
0
votes
0answers
54 views

Can't execute .sh file that works finely through the terminal in Xubuntu 16.04

My first attempt with scripts, is a shortcut to open a Jupyter Notebook on a specified folder from an file on the Desktop called ipython.sh. The content of ipython.sh is: #!/bin/bash cd ~ ...
1
vote
1answer
19 views

How could one export from a sourced script only specific functions

I try to expose from a script only specific functions. For example, let's say I have the script hello_world.sh and it has 2 functions, hello and world: ## hello_world.sh - name of the file, not the ...
2
votes
0answers
22 views

Scheduling Cron Job for a Specific Hour Range in a Week

I'm looking to run a cron job for specific hours in a week. The reason I'm doing this is due to the timezone being pegged exactly 7 hours ahead of New York time irrespective of daylight savings (this ...
5
votes
1answer
48 views

How do I exclude a specific extension from recursive file copying?

I want to copy all of the files and subdirs except the data file which named *.data to a destination dir. [ichen@ui01 sub_test]$ ls a.cxx a.data subdir [ichen@ui01 sub_test]$ ls subdir/ sub_a.cxx ...
2
votes
1answer
35 views

What does :(){ :|:& };: do? [duplicate]

What does this do: :(){ :|:& };:. I was reading through encyclopedia dramatica and saw that command. It just being above rm -rf / --a-flag-we-don't-mention-here makes me anxious about trying it ...
0
votes
0answers
19 views

Terminal fails to connect to a proxy server

I am trying to connect to the proxy server of my university. I have successfully logged in to proxy via firefox but when trying to use ftp or wget I get the following error: Resolving ...
-1
votes
2answers
47 views

bash send output from command to variable

I am trying someting very easy, I have seen some answer, but they do not work I am trying to send the output of ls-al to a variable some code before this line if [[ $ans == "L"* ]];then ...
-1
votes
1answer
58 views

Complex Number and String comparison

In a bash script the user enters an 8-digit number after being prompted for input. echo "Enter an 8-digit number." read NUM After this a function is executed that generates a single-digit random ...
0
votes
0answers
42 views

I have a problem with a loop in a script. How I can create a loop in a loop?

I'm doing a script for improving my scripting capacities, but I can't make a loop work, how I can fix it? Here's the script: As far as my knowledge go, the problem is in the below script: read op2; ...
1
vote
2answers
187 views

nmap in a shell script : some issues

I decided to make a shell script for basic nmap scanning so I did it like this : #!/bin/bash sudo apt-get install nmap printf "enter the name of site to do basic scan on >>>" read NAME ...