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

learn more… | top users | synonyms

0
votes
1answer
19 views

place the MySQL libraries in the correct location

Run the following command to place the MySQL libraries in the correct location: cp /usr/local/mysql/lib/* /usr/local/lib/ and I get bash-3.2# cp /usr/local/mysql/lib/* /usr/local/lib/ cp: /usr/...
2
votes
3answers
37 views

How do I search for substrings in Bash?

I want to find out and display the total amount of TTT substrings found in the first 2,000 lines in the file. I had been using grep until I tested it, and realized it does not identify substrings.
0
votes
2answers
26 views

Pass variable to another pane

I'm working with tmux and I'd like to pass some information from one pane to another. For example in first pane i've got the folder by pwd command and instead of copypast to another pane I want to ...
1
vote
0answers
30 views

way to automate git repositories cloning

I have to clone several repositories on the VM-s and then building software on them. I have pretty nice build script but there is one issue. Before build, several repos should be cloned, and after ...
0
votes
1answer
151 views

curl command not found on OSX El Cap

My understanding is that curl should be installed. I had tried using curl from the Unix command line and got the message it could not be found. I'm wondering If something I did in efforts to clean up ...
0
votes
3answers
47 views

how to pass output of grep to “lsof -p”

I want to know the path of currently running ./a.out There are several MPI process, but I only need one of the PID of several ./a.out. So I first use below code to grep it ps aux|grep -P "Rl.*a\.out"...
1
vote
1answer
98 views

How to get bash-style autocompletion in zsh, (for git command)

I switched to zsh and find it better than bash, but I have a problem with oh-my-zsh's (hereafter "OMZ") autocomplete feature. When I type git chec, OMZ completes that to git check; in bash it gets ...
0
votes
2answers
26 views

How can I eliminate double login?

When I login into my Mac OSX a bash shell is configured to automatially open and run a script. This script requires super user privs and asks for my password again. Is there a way to eliminate this. ...
2
votes
1answer
23 views

Bash Regex oddity when using =~ operator

Consider this code: s1="1,2,3,4"; \ s2="1,2,3"; \ sP='^(([1-9][0-9]{0,},){1,2}){1,2}$'; \ [[ "${s1}," =~ $sP ]] && echo "\$s1 matches"; \ [[ "${s2}," =~ $sP ]] && echo "\$s2 matches,...
1
vote
2answers
74 views

How to split a string with quotes (like command arguments) in bash?

I have a string like this: "aString that may haveSpaces IN IT" bar foo "bamboo" "bam boo" I want to be able to split it like this: aString that may haveSpaces IN IT bar foo bamboo bam boo ...
1
vote
3answers
110 views

Bash on Windows: mv command - cannot move to a subdirectory of itself

I'm trying to install Ruby from sources on the Windows Linux Subsystem. I've successfully built from source in my home directory: ~/ruby/ruby-2.3.0 and I'm trying to move it to /opt/rubies/. When I ...
1
vote
0answers
101 views

Bash on Ubuntu on Windows: Can't change (some) directory colors

On the new Bash on Ubuntu on Windows (10) app, I have tried to change the directory colors from blue to some thing more visible but haven't been able to change some file/directory colors for some ...
1
vote
1answer
33 views

Mac Pro - $PATH messed up and “command not found” errors

I was installing opencv Python on my Macbook pro el capitan and in setting up the path messed up my .bashrc or path etc. I tried several of the suggestions on the SO and SU, to no luck, now i am ...
0
votes
1answer
38 views

email me when external ip changes

I'm trying to write a bash script for my server. What this script does is runs curl to get the latest IP address of my box and then email me if it's different from the old IP address stored in a file. ...
0
votes
1answer
223 views

How to access Windows folders from Bash on Ubuntu on Windows

On the Bash on Ubuntu on Windows app, I only have root@localhost:~# ls -a .bash_history .bashrc .profile How do I access all of the Windows folders like Documents, Downloads, etc.?
-1
votes
1answer
92 views

Bash on Ubuntu on Windows: ls command returns nothing at root level

On the new Bash on Ubuntu on Windows app on Windows 10, I tried to run ls from the starting directory to see the subdirectories but nothing comes up. I don't really know the directory structure so I'm ...
1
vote
1answer
22 views

Access to line arguments in shell script

I wonder if there is possible to access full command line call in shell script. In my script I need to pass it further. I find that there are $@ and $* accessors, but it do not pass all the characters,...
0
votes
1answer
44 views

How to suppress output of bash command

I've found this way of checking whether a host is accessible on a given port, however I am only interested in the status code of the command, therefore I am trying something like this: [CptBartender@...
0
votes
1answer
24 views

Shell Save the array element values in the variables

I need to copy the files from one folder to another, here source and destination information are in the text file. File content: res.txt /var/lib/jenkins/jobs/Android\ Gradle\ test\ build/workspace/...
-6
votes
1answer
33 views

converting shell script to bash script

can anyone help me by converting this shell script to bash script pl. my shell scrpit is as follows #!/bin/bash IN="ifa_in_B2C=ifa_inB2C;ifa_in_ERP_Soap=ifa_inERP;sm=sm_main;tp=tp_main;trp=trp_main;...
0
votes
1answer
31 views

Bash script to find content of file in a directory and add value

I have a directory with a huge number of files. I want to write a bash script to - Enter that directory Find out which of them are Perl scripts (but none of them have a .pl extension) Add a line at ...
0
votes
0answers
18 views

How do I create a Docker container with a non-default IP address?

I created a docker container with this command: docker run -p x.x.x.x:80:8080 <imageName> bash where x.x.x.x was the IP address of the Docker server running CentOS version 7. I then tried to ...
1
vote
1answer
235 views

Force download Windows update to build 14316

I’d like to try the new Ubuntu Bash on Windows, I’m already on the insider preview program and every time that I do a “check for updates” I don’t get any new update. My current build is 10585.218 and ...
14
votes
1answer
2k views

How to remove/reset Windows Subsystem for Linux on Windows Insider Build 14316

I installed the Windows Subsystem for Linux on Windows 10 Insider Preview build 14316. Now I would like to remove it or, better, revert to its factory defaults i.e. as it was when just installed. I ...
0
votes
1answer
21 views

Shell how to use a command to every regular file in and below the Dir

So what I have to do is find all regular files within and below the directory. For each of these regular files, I have to egrep for pattern($ARG) and find out if the output of the file matches the ...
0
votes
0answers
35 views

Update Azure VM running Windows 10 Enterprise N to build 14267?

I have Windows 10 Enterprise N running in an Azure VM and I'd like to update it to a newer build so I can try out Bash for Windows. It's setup to receive Insider Preview builds and its set to the "...
0
votes
0answers
24 views

Set PDF File Metadata from the Mac BASH Command Line / Script

Is it possible to set a PDF File's Metadata (Author = "Fred Smith" and Title = "This is my Book") from the Mac BASH Command Line or Script?
0
votes
1answer
56 views

Why might I be getting “Permission denied” for a directory that seems to have correct permissions?

I'm a member of the group that owns the directory dir, but I can't seem to access it. I'm not sure why I could possibly not have permission. See below: $ groups various including dir $ cd dir -bash: ...
0
votes
0answers
21 views

Force graphical login of a newly created os x user from bash

I'm working on an OSX build script for our department, and I've discovered that, although I can create a new users, I'm not able to set many preferences for that account until the account it logged ...
1
vote
2answers
84 views

find and exec on only filename

I need to find all files older than X days and delete them locally and from my s3 bucket. The problem is the find command returns me the full path and filename too. I tried messing with basename and ...
1
vote
2answers
315 views

Windows 10 build 14316: Ctrl + v doesn't work on Bash on Ubuntu on Windows

On the new Windows 10 insider build 14316, I haven't been able to use Ctrl + V (shortcut for paste) on the new Bash on Ubunbu on Windows app. Has anybody else had this issue? Any solutions? I have ...
1
vote
1answer
22 views

Bash: Is it possible to declare each list item on a new line?

Example: You normally list values in a horizontal layout for var in 0 1 2 3 4 5 6 7 8 9 do echo $var done It would be nice for version control and readability purposes to enter each list item on ...
0
votes
2answers
434 views

Bash on Ubuntu on Windows (10) - Unable to connect to Upstart

Running the Ubuntu 14.04.4 LTS release (Trusty) using the new windows beta release with "Bash on Ubuntu on Windows" support. I'm having issues running services requiring upstart. ie: [15:08 root@...
0
votes
0answers
22 views

Trying to track a PID in windows created from the pub command

I am doing some Polymer and Dart development, and when I am running the server, i run pub serve in order to spin up the server. The issue is that to stop the server, i need to break out of it <...
2
votes
1answer
38 views

Differences between how the find command interprets units of size

When I issue find / \( -type f -size +10M \) -and \( -type f -size -1G \) I don't get any results. However, when I type find / \( -type f -size +10M \) -and \( -type f -size -1000M \) the ...
0
votes
0answers
35 views

Source windows environment variables in MSYS

I have a setenv.cmd script which contains paths for the windows cmd prompt: set CURRENT_SCRIPT_DIR=%~dp0 set PATH=%PATH%;%CURRENT_SCRIPT_DIR%\bin But I'm using bash (via msys in the git for windows ...
1
vote
1answer
73 views

Linux ip route: How to make all external traffic go via one interface

I've set up an OpenVPN connection with an external server. tun0 is the interface which is used for this connection: user@mypc:~$ ifconfig tun0 tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-...
0
votes
0answers
25 views

cygwin: git commit - vim Editor always in line 5 but not on file edit

I am using cygwin on windows and git from the shell. VIM is configured as my default commit message editor. When I am editing my commit message, ie $ git commit my cursor always resides to line 5 ...
0
votes
1answer
24 views

'\' backslash in single quotes giving unpredictable output in shell script linux

the output for the following two commands are same: echo 'my\name' | grep 'my\\name' my\name and also the output for the next command is also same, echo 'my\name' | grep 'my\\\name' my\name Can ...
0
votes
0answers
24 views

Startup script unexpected results

I'm experimenting with a small script to setup my webserver on Vultr. This is a "Startup script" that is used by Vultr on the background after deploying a new machine for me. If I run manually with ...
1
vote
3answers
261 views

WSL(ubuntu/windows) AppData\Local\Lxss doesn't actually sync back to ubuntu, ideas?

If you create a file in bash (touch /root/foo.txt) that appears in the hidden directories in AppData\Local\Lxss\ modifying it there does not change it in bash. Worse if you change it again in bash ...
-2
votes
1answer
19 views

change the default directory of command

I have two programs named abc in different directories (/dir1/ and /dir2/). Each of these directories contains other programs. In general, I would like dir1 to be searched for a command before dir2. ...
0
votes
0answers
18 views

Cron job appears to work, but no changes seen in file

I have a simple cronjob that uses curl to download a file and save the contents to a file. The crontab file reads: 45 17 * * * /home/my_username/public_html/./update_md.sh where update_sh.md = #!...
1
vote
0answers
24 views

How can I delete every hourly backup except the 24 most recent ones?

I used to have a server with hourly/daily backups, all readily available thanks to this nice tutorial. Unfortunately, said server fried and I now have to make my backups on a NAS which doesn’t run1 my ...
0
votes
2answers
19 views

running chained bash function commands in background

I am attempting to call port() { fuser -k $1/tcp; python manage.py runserver $1 ;} runproject() { cd $HOME/projects/$1 ; workon $1 ; port $2 & ; sleep 3 ; google-chrome 127.0.0.1:$2 ;} (port is ...
0
votes
1answer
74 views

Cannot execute Binary file on Mac OS

Here is a repo that I am trying to clone. https://bitbucket.org/sivareddyg/hindi-part-of-speech-tagger It says, we support UNIX based system. So I tried running "make tag" on OSX terminal. But it ...
0
votes
2answers
91 views

Have script run on very first startup of new CentOS 7 VM clone

I'm setting some servers that basically need to manage themselves after I leave the company, as I'm just the contract IT guy. Whoever manages this should basically be able to clone a VM image in ESXi, ...
0
votes
0answers
11 views

Assigning terminal command to change a specific preference setting

Following the useful guide available through A Modern Story, I've installed Hadoop on Mac OS X for the learning purposes. I start Hadoop by typing hstart and hstop, which correspond to the following ...
0
votes
1answer
181 views

User accounts under WSL (Windows Subsystem for Linux)

I have noticed while browsing the Windows blog for information about the latest Insider Preview release (Build No. 14316), that the bash when installed gives you a root prompt by default. ...
0
votes
0answers
29 views

Virus keeps appearing. How can i find the security hole?

I just started working with this client recently, and when i got into his server, it was full of viruses. At least 4 of his cpanel users had viruses on their websites (completely managed by him). The ...