Bash is a free shell for Unix-like operating systems from the GNU Project.

learn more… | top users | synonyms

0
votes
1answer
26 views

wget script exit abnormally with error 126

Can't seem to get this script to run, I have user access to the data I'm trying to download but it just won't run. If anyone can help with wget scripts it would be appreciated. for i in $(seq 1 9); ...
0
votes
2answers
8 views

Monitor log live for error. If error = rerun command and restart log monitoring, if not found = keep monitoring forever

A process in a bash script I'm developing often fails quietly (it keeps running with no error code, but it writes the error in its log file). As soon as the error appears in the log file I want the ...
0
votes
0answers
11 views

Not getting any values passed through to RRD graphs

I'm getting a lot of NaN values being drawn on my RRDTool graphs and I can't understand why. My script to populate the RRAs in the RRD: #! /bin/bash LOAD=`cat /proc/loadavg | awk '{print $1}'` ...
0
votes
4answers
37 views

Bash background process still blocking script flow in subshell

I am trying to do something that involves scripts calling other scripts in subshells to capture their output. One of the scripts needs to have a side effect of starting a background process. This all ...
0
votes
1answer
15 views

executing history command as another user

I am confused as to why I'm having problems executing a history command as another user to return all that user's history - I need to loop though all users and get their history cat /etc/passwd | awk ...
0
votes
0answers
9 views

How to use scroll wheel for command output history in a minimal install

I apologize beforehand if this is either too general, or just in the wrong place but I have no better place to ask this. If someone ever booted up a GNOME desktop and accessed the terminal you would ...
1
vote
1answer
22 views

Launch consecutive commands in screen

I would like to launch cmd1 and cmd2 in the same screen instance. I want cmd2 to be launched only when cmd1 has completed. I have tried this: screen -d -m ./cmd1.bash "$File" && ...
1
vote
0answers
16 views

How correct this local mail-sender script?

I have a task, write a shell-script, that: - All e-mails, that received by the user specified by the first parameter, sends to the currently running system users; - If sender is online, ...
1
vote
1answer
26 views

Bash Script, Striping out newline characters in variable

Still getting the hang of bash scripting... I have a function that resizes images and calculates how much to scale it based on the file size. I need to pass this percentage as an argument to the ...
0
votes
0answers
7 views

notify-send not showing popup message

I have a script which executes on certain conditions, whenever I manually execute the script, the popup appears, however if i try to aumotate the script(i.e. run the script right after system is ...
0
votes
2answers
24 views

How to use crontab to launch scripts

I have created a script (which I already tested if it works) and I want to use crontab to launch it everytime my pc reboots. I created these script called test.sh just for fun and it's pretty easy: ...
0
votes
1answer
17 views

Script not running on resume/wakeup in Ubuntu

I have a script named 999_thaw_flash.sh in my /etc/pm/sleep.d The script follows like this :- export DISPLAY=:0 #!/bin/bash case "{$1}" in resume|thaw) lynx --dump link1 >> file1 lynx ...
1
vote
2answers
35 views

Custom script run with sudo - command not found

Problem: Running a script as sudo returns sudo: mount-remove-hiberfile: command not found Info: Scripts folder: '/scripts' (all my custom scripts are kept here) My User: 'cybex' ...
0
votes
1answer
24 views

how can i get SYN & SYN+ACK value for current tcp connection of any website on Browser?

As I know that '$sysctl | grep net.ipv4.tcp' gives the system wide TCP parameter value,I need to make a script in Bash for my college practical file in which If we open Browser and input the ...
1
vote
1answer
53 views

How do I close a windows program in BASH

I use X64-based Win10. Recently, I started to use git, so I am switching the console to bash/mingw64. But I don't quite understand the way bash behaves. I tried to kill a program, say notepad, via ...
0
votes
0answers
16 views

Creating a bash script or something to run through several directories

I had a quick question. I have the code below, which as you can see, I am loading in a file. Note that I am in the folder "Angle1" and that I am in the subfolder "1eV" The code works fine and does ...
0
votes
0answers
27 views

Close process gracefully that has no window

So, I have a script that starts some auto-hotkey scripts while also starting up a game. I want those scripts to close again when the game ends. Currently I'm doing this with the kill command. This ...
2
votes
1answer
25 views

How to set different shell prompt color for each newly opened terminal

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 I ...
0
votes
2answers
15 views

cron job on centOS 6.5

I have used these 2 references to insert a new crontab entry. redhat ubuntu I have created a new bash file and moved it to /usr/bin. That sh file has execute permissions for the root user and the ...
0
votes
1answer
29 views

Why does terminal repeat “//: is a directory” after I source .bash_profile?

Sergios-MBP:~ home$ nano ~/.bash_profile Sergios-MBP:~ home$ source ~/.bash_profile -bash: //: is a directory -bash: //: is a directory -bash: //: is a directory -bash: //: is a directory -bash: //: ...
-3
votes
2answers
18 views

I need help building a regex for a grep to show only the path to running versions of java

I need help building a grep from ps -ef to return only java paths. Say we have the following runnning process: bash> ps -ef | grep java user pid# 1 1 00:00 ? 00:04:00 ...
1
vote
2answers
39 views

Ubuntu find files and directory matching a name in one line

There are parameters of find command for finding files and directories respectively -f and -d, but I want to avoid writing two find commands and && or || between them. I want to find file or ...
0
votes
0answers
15 views

Extracting zip files within zip files

I have a file which contains an unknown extremely high number of zip files, only within each other, and a file at the bottom, like so: ...
0
votes
0answers
15 views

Matching 3 or more words from fields in seperate csv files.

I have two csv files: This is csv1: 11, The Sun Still Shines in Reading, 64312, 464566 13, You and Me Together Again London, 564564, 131355 12, What's the Story Now Your Gone, 4545646, 1124545 17, ...
2
votes
1answer
30 views

How get the value of TCP connection establishment timing,retry timing in ubuntu 14

how i get the value of TCP connection establishment timing ,retry timing for any TCP connection and also Quality of services parameters in Ubuntu .
1
vote
1answer
27 views

How to use '!!' (double exclamation) in bash script?

This is the scenario: Sometimes I want to open a list of files using vim. That list of files is output of a command. So I can type vim $(!!) and open those files after running that command. Is it ...
1
vote
0answers
11 views

Acer Aspire One - Console Opens on Boot "Unable to open Display ' :0.0'

My mother just gave me her Laptop (Acer Aspire One ZG5) and showed me the following: I tried to change the hostname, which should be a solution for this problem, but I've noticed that I havent got ...
0
votes
2answers
21 views

Exclude a directory from `ls -R` command in FreeBSD

I want to list all of my files in a directory in FreeBSD 9.2, but I don't want to include a specific directory. I checked both -I and --ignore parameters for ls, but I only ignores superuser mode and ...
0
votes
1answer
17 views

Creating another user for a certain domain

I typically tend to log in as root, which I know is bad practice. So I created another user, let's call it user1. Except now when I log in as that user I am placed in an empty /home directory and it ...
0
votes
0answers
25 views

How can I make git bash `which` command work with windows?

If I type which node in git bash in Windows, then I get node's path, but when I type which open, it says it's not found. The open program is in PATH, but not marked as executable since chmod +x ...
0
votes
1answer
23 views

How to create a “run as admin” bash shortcut

To run bash console (Windows) as admin in a project folder, currently I first launch bash as admin then manually navigate to the folder which is excruciatingly laborious. Any way to get a graphical ...
0
votes
1answer
26 views

How to remove file on Linux with ? in name

Cannot move or remove file with ? in name. Any ideas? Have tried the following: # ls manager?%80%99s-viewpoint.html what-wcsap-can-offer-you-?%80%93-guide-new-directors.html # mv ...
-1
votes
0answers
15 views

Self-contained installer in korn shell script with sed, grep and gzip

There's a great post on this here: http://www.matteomattei.com/create-self-contained-installer-in-bash-that-extracts-archives-and-perform-actitions/ But is uses Bash interpreter, tar and awk. I need ...
0
votes
0answers
11 views

GPIO on openwrt like on DD-WRT

On DD-WRT i can control LEDs by command gpio enbale X gpio disable X But on OpenWrt it does not work. -ash: gpio: not found I have tried opkg install gpio but it does not work (Package does not ...
1
vote
1answer
39 views

Permission denied when trying to read temporary file created in bash

I am trying to write a script which takes as arguments one or more files and transposes the upper case letters to lower case letters. The contents of the original file is replaced with the lower case ...
0
votes
1answer
23 views

Linux suppress find error in bash script combined with file delete

I have a one line script which works fine but... find $HOME/html/mydir/downloads/sec/*.zip -mtime 2 -exec rm {} \; It generates an error if there are no files found and my web host then sends me a ...
0
votes
0answers
9 views

Can MobaXTerm set environment variables on SSH connection?

It is possible for the OpenSSH command to set variables for a connection (e.g. http://superuser.com/a/163228/7173). Is it possible for MobaXTerm to do the same? The commands I run to setup my profile ...
-1
votes
0answers
13 views

Directory-based reverse-i-search in Bash

Is there any way to perform reverse-i-search in Bash so that it shows only results that have been ran before in the current working directory?
-1
votes
2answers
46 views

echo $path returns blank on Mac

echo $path is returning blank for me. The following are contents of my .bash_profile. CHANGE PROMPT export PS1="►►" export TERM=xterm-color export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' ...
1
vote
2answers
101 views

Using NPM in the new Windows Bash

I've been playing around with the new bash terminal in Windows 10 to see if I can switch over to a Windows dev environment. Since the environment is fairly new and still in beta, it's been tricky to ...
0
votes
0answers
22 views

Any good way to momentarily block submitting a command if a tab-completion is ambiguous? [migrated]

Occasionally I go to type a command, think I've gotten enough of the filename that Bash can complete it, hit Tab, and then hit Enter before I notice that the filename didn't complete. Most of the time ...
0
votes
1answer
22 views

Sending gist to github via cURL and issues with new lines inside file

So, let's say I have an index.php file containing this: <?= "Hello" ?> <?= echo "WORLD" ?> And I wanted upload the contents of this file to my gists in github, which I am doing via ...
1
vote
0answers
32 views

Matching a randomly generated integer with a specific place value in a string

In bash I want to prompt user for input in a script. Lets say the input is: #!/bin/bash echo "Please enter a number." read NUM # User enters "12345678" How can I use the next command to generate ...
0
votes
2answers
61 views

SSH Difference between ./ and sh

I wrote simple file "hello world" and try to execute it on virtual server by SSH. #!/bin/bash echo "Hello world" Of course I give chmod +x Then on one server I try to execute it by command: ...
0
votes
1answer
32 views

What does this bash command do?

I accidentally typed the following. What does it do? gulp lint &7 gulp test I intended to type &&.
1
vote
2answers
150 views

Open Ubuntu Bash's GUI applications on Windows 10

I have installed Windows 10 Insider build just to use Ubuntu Bash. I noticed its entire Ubuntu on Windows so I tried to install a GUI app i.e. Gedit. It was installed properly but when I try to open ...
0
votes
1answer
23 views

Automated way to run bash script inside Ubuntu hosted in VirtualBox?

I have Windows 7 as host OS, and Ubuntu 14.04 as guest OS running under VirtualBox, I have some shared folders with data between Windows and Ubuntu and some binary in Ubuntu that do some processing of ...
-1
votes
1answer
44 views

Why does this “find” command scan all directories?

I only want to recursively scan Documents and not leave that "parent" folder. My script scans recursively my entire file system, and I am not sure what element of this script is causing that to ...
1
vote
0answers
36 views

Purpose of function export in bash

If we take a look at the following example: # testing(){ echo hello;} # testing hello # echo $(testing) hello # echo testing >script # ./script ./script: line 1: testing: command not found # ...
0
votes
1answer
25 views

Alias to attempt mounting multiple times doesn't work correctly

I have the following in my .bashrc alias ext='sudo mount /dev/sd'{b..d}'1 /ext/hdd || sudo' I intended the alias to mount my external hard drive without having to worry about the semi-random ...