Questions tagged [bash]

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

2,569 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
0 answers
315 views

Unable to launch matlab after installation

I have recently installed a copy of Matlab on my Linux Mint distro to a secondary hard drive. I have tried running it in different ways and none of them seems to work. I have tried using sudo, and ...
Fat-chunk's user avatar
  • 111
1 vote
0 answers
677 views

Custom script in /etc/rc.local - not starting X properly

I made a script called starter.sh: #!/bin/bash while true; do sudo fluxbox & sudo -u pi epiphany-browser -a --profile ~/.config http://localhost/index.php & sleep 2s done; Which is ...
tarzanno's user avatar
  • 187
1 vote
1 answer
453 views

redirection - why it doesn't work this way

I know there are 3 streams attached to a process when it is run namely the input, output and error stream. And redirection execution work from left to right. I intend to execute a command, redirect ...
Noob's user avatar
  • 1,595
1 vote
0 answers
536 views

Make static site from wordpress site using bash

I have tried a few other scripts that can make a static version of a wordpress site but none of them are designed for bulk sites and I haven't found any that will just serve a static version while ...
bartle_man's user avatar
1 vote
0 answers
72 views

MinGW Git Bash observable progress output inconsistency across machines

I am getting inconsistent behavior across installations of Git Bash on different Windows 7 machines. The diff in behavior is fairly minor, but I'd like to understand what could be responsible for the ...
K. Alan Bates's user avatar
1 vote
1 answer
1k views

Script to monitor realtime CPU & Bandwidth usage in xen live migration

I need to write a script (bash or python or ??) to perform live migration of a VM in xen, and to simultaneously log and extract the CPU & bandwidth usage of the Domain-0 AND write the output into ...
Ali's user avatar
  • 111
1 vote
0 answers
349 views

bash change directory with "shortcuts"

On my windows computer I use JPSofts "Take Command" a.k.a. TCMD as command.com or shell replacement. One tcmd feature I really miss when working with bash on Linux/Os X, is the extended directory ...
lexu's user avatar
  • 1,872
1 vote
0 answers
416 views

Controlling a Canon Powershot with a CGI/Bash Script

I am trying to control my camera through the program chdkptp by using a CGI/Bash script. I have successfully controlled the camera by typing in the commands by hand: pi@camerapi /var/www/chdkptp $ ...
Chris2fourlaw's user avatar
1 vote
0 answers
123 views

executing script on remote host by ssh

I wrote a script test.sh (its function is the same as "hostname" command) as below, #!/bin/bash printf "`uname -a | awk '{print $2;}'` " I can get my hostname with source /home/arton/test.sh or ...
Arton's user avatar
  • 161
1 vote
0 answers
209 views

Issue installing Java EE 7 SDK update 1

I've installed Java (jdk 1.8) and set JAVA_HOME, now I'm trying to install Java EE 7 SDK which I downloaded it from here. The Oracle download page shows Universal Zip Installer type file, downloaded ...
GIRI's user avatar
  • 264
1 vote
1 answer
368 views

Monitor SSH login's via slack but hangs on SCP

I'm playing around with some slack integration so that every SSH attempt gets sent to a slack channel The script below works perfectly for SSH attempts but the issue is that when I preform a SCP to ...
Grimlockz's user avatar
  • 205
1 vote
0 answers
284 views

Run bash command from link in browser

Is there a way to run an arbitrary command on OSX by clicking a link in the browser? As you know, there are certain types of hyperlinks that launch certain applications with a specified action, for ...
Gerard's user avatar
  • 413
1 vote
2 answers
6k views

error in script (bash): ambiguous redirect

I'm rewriting a simple script, CopyScript.sh, I wrote a few years ago to copy contents from my NAS to a USB disk. #!/bin/bash SYNCPATH="/volume1/" SYNCPATHTO="/volumeUSB1/usbshare/synology-may-2015-...
sandokanfirst's user avatar
1 vote
1 answer
4k views

Parse csv file and for each object set as a variable

What I'm trying to do is parse a csv file that has server names and ipaddresses and assign these to variables I then run commands using each set of variables. So if the cvs file, test.csv, looks like ...
Regicus Maximus's user avatar
1 vote
1 answer
175 views

Can bash reverse history search (Crtl+R) be configured to NOT delete history?

I find Ctrl+R very useful, however I am really anoyed that when I press the backspace key, it deletes the currently matched entry in the history. Is there a way to disable this ?
Max L.'s user avatar
  • 131
1 vote
0 answers
140 views

How does OS X's Terminal pass the new tab's dir to login or bash?

In OS X, you can add a shell to /etc/shells and set it as a user's default shell, such that when they open the terminal they are presented with that shell. In addition, you have the option to open all ...
Camden Narzt's user avatar
  • 1,179
1 vote
2 answers
2k views

Is there an equivalent to source which allows me to have a batch script alter environment variables of the parent bash process?

My situation is this: I use python with conda on a windows machine, and work mostly in cygwin when on the command line. Now conda allows for different python environments, similar to virtualenv, but ...
kutschkem's user avatar
  • 194
1 vote
1 answer
730 views

Refer to Wildcard in File Name

I know I can use a wildcard to extract files with names of a specific format in bash using the asterisk, like so: $ ls a01 a02 a03 a04 a05 a06 a07 a08 a09 b01 ...
kumowoon1025's user avatar
1 vote
1 answer
33 views

Problems with function checking if a path exists or not

I am a little new to bash scripting and I was trying to make this program capture a directory path from user and then check if the directory is present. It seems as if the variable SRC inside the ...
Luis's user avatar
  • 11
1 vote
1 answer
483 views

VIM + screen on remote (ssh) linux machine

The problem happens with my text in vim when I'm working inside of screen this is my .screenrc file defshell -bash startup_message off term screen-256color and this is what I can see in my terminal (...
user1016265's user avatar
1 vote
0 answers
62 views

Linux: Finding Processes I Started To Kill Them

I am programmatically starting several servers in Gnome terminal with each server in its own titled tab: gnome-terminal \ --tab -t "Server1" -e 'bash -c "export BASH_POST_RC=\"pathtoserver1/server1\...
user787832's user avatar
1 vote
2 answers
538 views

How do I remove the extra bash-3.2$ from shell-mode?

Summary The first line of shell-mode has an extra bash-3.2$ prompt before my custom dotfiles (master)$ prompt. I tried writing PROMPT_COMMAND='' in my ~/.bashrc according to an earlier Stack ...
mcandre's user avatar
  • 3,036
1 vote
1 answer
2k views

.zshrc doesn't export variable for anaconda

I installed Anaconda Python on my Mac today and following line was added to .bash_profile by Anaconda. Since I am using zsh so I moved this line to .zshrc. However, it doesn't work properly even if I ...
Young's user avatar
  • 11
1 vote
1 answer
219 views

Bash history deduplication causing dangerous multi-shell behaviour

I am using the following code in my .bash_profile to filter and de-duplicate my bash history: shopt -s histappend HISTSIZE=100000 HISTFILESIZE=100000 HISTCONTROL=ignoredups:erasedups PROMPT_COMMAND="...
hyperknot's user avatar
  • 892
1 vote
0 answers
135 views

ICMP flood with ping working only one time

my problem is simple: The first time I made a flooding ping to a fake ip on my network (for testing if someone is on promisc mode), it works perfectly: $ping -f 192.168.1.10 After perfoming this, ...
David Mic's user avatar
1 vote
0 answers
149 views

Stop automatic comments in my crontab

I have added the bellow cron jobs in my crontab : 0 5 * * * /bin/systemctl restart gb_subagent.service 28 13 * * * /home/comment.sh &>/tmp/errorcron.log 29 13 * * * bash /home/...
Peter Hayek's user avatar
1 vote
1 answer
2k views

Rsync delete only remove older source files

Ok, I could probably spend a lot of time writing a complex set of bash scripts that would accomplish this, but I'm hoping this functionality already exists somewhere. I have a device in my car which ...
megadave's user avatar
1 vote
0 answers
778 views

cp: cannot stat error - when filename has Asian characters

I am simply trying to copy files using cp -r /home/user/source/ /home/user/destination/ but it throws me the cp: cannot stat /source/filename.xxx error for some of the files. When I searched for this ...
Abhinav's user avatar
  • 111
1 vote
1 answer
2k views

Escaping asterisk * in Bash on Windows

The following command works in GNU Bash on FreeBSD but not in Git Bash on Windows: curl -X PUT https://example.com/_config/cors/origins -d '"*"' The intended result is to send a PUT request to https:...
Tamlyn's user avatar
  • 310
1 vote
0 answers
100 views

monitor command outputs in separate windows within a terminal

For a list of input text, I want to execute a repetitive command using each element from the list. In addition I also need to monitor the results of each of these commands in parallel. So I am looking ...
Vivek's user avatar
  • 111
1 vote
1 answer
125 views

How to move unopen files to another folder

I´m beginner in Linux and I want to build a script in bash to check which files are open in a folder and move any other files - those that are not open to another folder.
Petr's user avatar
  • 21
1 vote
0 answers
1k views

Can I have server and client on the same machine and run network bandwidth test using iperf?

I have two ethernet ports (eth0 and eth1) on my system. I've tested the bandwidth with two systems and got ~940Mbit/s. If I use one of the ports as server and the other as client, I always go through ...
tmp's user avatar
  • 121
1 vote
1 answer
1k views

Bash - Parsing XML output of nmap

I am trying to write a bash script that will take port id I retrieve from an nmap command, and then use those ports to send a file using netcat. So I got some basic knowledge using this link, How can ...
soccerman stan's user avatar
1 vote
1 answer
358 views

BASH - run commands before and after loop

I'm having a bit of trouble with a shell script. It's something so stupid I'm almost ashamed to ask, but I can't figure it out. This is the script: #!/bin/bash MAGAZINE=" 192.168.49.3 192....
Faryus's user avatar
  • 11
1 vote
1 answer
182 views

ssh | how to handle errors for multiple commands

Hi I am aware that we can check the status of previous command by $? following scenario is not working for me ssh $USER@$HOST bash -c "' echo "Preparing list of files to be transferred...." rsync ...
Mayank's user avatar
  • 11
1 vote
1 answer
571 views

SSH - Ignoring $PS1 in .bashrc

Relevant file contents: http://pastebin.com/6VtWcaWG Everything else including the aliases and the PATH variable are fine, but when I log in as root on my remote machine, the correct $PS1 (set in the ...
Thisguy_'s user avatar
1 vote
0 answers
91 views

Top -l returning always 0.0 CPU usage when requesting single PID

On Mac OS X 10.9 (Mavericks) & 10.10 Yosemite I’m unable to get the correct CPU usage for a single process using the top -l command for example top -l 1 -ncols 3 -pid <pid> Even though I ...
Roy's user avatar
  • 113
1 vote
1 answer
926 views

Change R BLAS library path

Currently the R on my system using this library for `BLAS': ldd /usr/lib/R/bin/exec/R libblas.so.3gf => /usr/lib/libblas.so.3gf I want to change the path to use ACML. Is it possible to change ...
user1436187's user avatar
1 vote
0 answers
373 views

Unable to run script, which emails me results, as super user. (returns: send-mail: 550 5.1.0 Not our Customer)

I have been trying to debug this for 2 days now, without success. This is the script I'm trying to run: #!/bin/bash emailaddress='[email protected]' output=`sudo rsync -av --delete /media/sync/1/...
draugr's user avatar
  • 11
1 vote
2 answers
1k views

Remove directory that is listed as "No such file or directory"

I have a folder on an external harddrive that has a curious folder in it that shows up as "No such file or directory" when I do a directory listing. See screenshot below. How do I remove this folder ...
Marcel's user avatar
  • 1,107
1 vote
1 answer
156 views

bash script processing files with bad characters

I received a zip file with a folder structure that include parenthesis. I've worked through two processes at the cli and now merge them into a script The first searches through the file structure for ...
carter's user avatar
  • 25
1 vote
1 answer
125 views

Bash script starts my program two times

I have a custom daemon program in C, which is a daemon. The usage is as follows SampleGame /directory1/ /directory2/ /directoryN/ I've made the same into a bash script. When I start it, the ps -...
Ilian Zapryanov's user avatar
1 vote
2 answers
50 views

Having trouble replacing a specific hyphen in directories that follow a specific format in Bash

I have a list of directories using the format: 2014-12-03 13-03 2014-09-03 12-07 etc. I need to change them to: 2014-12-03 13:03 2014-09-03 12:07 … I’m trying to do this with for d in *\ ??-??; ...
rrr45's user avatar
  • 11
1 vote
1 answer
165 views

How to delete unwanted directory paths in zipped file?

Using bash on OS X 10.10 I'm zipping a folder and saving it elsewhere using this: _now=$(date +"%Y-%m-%d-%H-%M-%S") pushd /Users/me/Documents/local-backups/writing zip -r /Users/me/Documents/local-...
GMag's user avatar
  • 11
1 vote
1 answer
1k views

Symlink directory into an existing directory (merging files)

I have a ghc directory containing ghci.conf: $ tree ghc ghc └── ghci.conf 0 directories, 1 file And ...
jviotti's user avatar
  • 167
1 vote
2 answers
228 views

Linux/Bash: Create relative soft links to files in directory tree?

I'd like to make links to all files in a directory tree. Which means, create the same directory structure and make the links in them to the respective subdirectory in the original dir. That could be ...
Ondra Žižka's user avatar
1 vote
1 answer
750 views

cpio VS tar - what the best archive solution in order to compress hundred of directories to one file

in my Linux machine under /var/Recording directory. I have hundreds directories and each directory there are also directories and files include hard links and soft link . I want to compress all ...
maihabunash's user avatar
1 vote
1 answer
2k views

Can I use ProxyCommand to run arbitrary commands on a target server via a jumpbox/middle server?

At work, we have a number of servers that we can only SSH into from our jumpbox server. Every now and then I need to execute a command on these servers. For example, if I want to execute df -H on ...
Behrang Saeedzadeh's user avatar
1 vote
2 answers
430 views

Split multiple gz compressed files into even more files

I have a directory full of gz files. I need to split them into smaller ones, e.g. 1M of size. I do e.g. for one file: $ split --bytes=1m one_unzipped_file prefix_ but how to achieve for many files?
user avatar
1 vote
1 answer
1k views

sudo cp with wildcard syntax doesn't do anything in Linux

I have a directory containing files that are owned by root, from this directory I wish to copy all the files ending with errorAll to another directory. My wildcard syntax is correct because performing ...
Bas Jansen's user avatar

1
15 16
17
18 19
52