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

learn more… | top users | synonyms

0
votes
0answers
11 views

Duration time between cycles in a log file

My apologies if this is too basic, but I have a log with this kind of information: Mai 5 12:34:00 xoengine XO[1287]: [Xo|xoengineMain.cpp:122|0xb88ec60] starting xoengine 4.0.1.2 (x86) from ...
0
votes
0answers
7 views

Running `pip` gives 'command not found' after successful Python homebrew install

To preface, I am very bad with the terminal, please be patient with me. when I run pip I get: zsh: command not found: pip I have installed Python 2.7.11 with brew, which should allow pip to work ...
1
vote
1answer
19 views

unable to remove symbolic links of rsync copy of /bin and /dev

I accidentally made a rsync copy of my root directory, "/" using the -a option, as follows: user@mycomputer:~$ rsync -a / /backup-dir user@mycomputer:~$ ls -l /backup-dir/ total 10102784 drwxrwxrwx 1 ...
0
votes
1answer
16 views

Looping through wildcard folders and executing multiple commands in Bash

I have a set of commands to change the contents of files called MenuSettings which work fine when directed to a folder. cd /Applications/snowflake/table-updater/Testing/Applications/Salford_100 sed ...
0
votes
1answer
32 views

Bash autocomplete behaviour in Debian 8

On a new install of Debian 8 (Jessie) I have found that the autocompletion in bash, using the tab key, has changed. The test I did was: Open a terminal (in my case Konsole). Above the prompt it ...
0
votes
0answers
6 views

Setting proxy settings to Auto Proxy Detection using command line Mac OSX

Hi I want to know how to set the proxy settings to Auto Proxy Detection like in network preferences but using bash. I have tried looking around but I only am seeming to find commands like this ...
0
votes
1answer
17 views

Why does du report different sizes for the same directory?

$ pwd / $ du -hs * 0 bin 8.2M boot 82M dev 23M etc 0 lib 0 lib64 16K lost+found 4.0K media 0 misc 4.0K mnt 0 net 106M opt 44K root 414M ...
0
votes
0answers
8 views

Stop bash script with any key

I'm writing a script which I want to stop with any key I choose. After pressing the key, my intention is to complete all my commands at that moment and start su. I've tried adding a & to my ...
0
votes
1answer
49 views

How can my macbook be able to ping google but not my router?

I've been having a lot of trouble recently with my macbook dropping internet connection intermittently. Every 5 minutes or so. So I've been trying to determine where the failure is occurring. Virgin ...
0
votes
2answers
25 views

How to pass parameter in linux command at the end of the line

I would like to pass a parameter at the end of the line while I am giving a command in terminal. So I would like something like the example below find /path/to/directory -type f -exec grep -irl ...
4
votes
1answer
39 views

Is it possible to suspend/restart a 'find' command?

Let's say I have a slow filesystem in which I would like to list all the files: find . -type f -printf "%p\n" Is it possible to launch this command in a way I can interrupt it, save the state and ...
1
vote
1answer
14 views

How to check shell options?

I want to check what options are enabled for my current shell. For example, I want to know whether I was invoked with -x or -e or any number of other options. I source a shell script with shebang ...
1
vote
1answer
24 views

Man pages are outdated

Background: I recently learned about the mv -t flag option in bash, but when I checked the man pages on my computer, there was no mention of it. The man pages were dated 9 July 2002. I ssh-ed into ...
0
votes
1answer
22 views

bash if statement keeps changing second argument to literal string

So I'm not sure why it's doing this. My if statement keeps interpreting the second variable as a literal string instead of a variable. Below is my exact code. lights() { bulb1state=$(gatttool -b ...
0
votes
0answers
7 views

Vagrant shell provisioner does not respond

I am provisioning a VM through shell script in AWS using vagrant-aws plugin. VM gets launched and the shell script gets executed but I don't see any update on the shell prompt. It used to get updated ...
0
votes
0answers
24 views

How do I configure a Jenkins job to target a specific server to deploy to?

I am using two CentOS servers. I am not using any code repository. In Jenkins when I click "New Item," I see no place to enter the target server. I expect a place to configure a target server for a ...
0
votes
1answer
22 views

How to overwrite an echo/printf line with another one? (Making it start at the center of the screen)

I want to write a script which outputs sentences I choose. I want them to appear in the center of the screen: output the first one, and then make the second one appear over the first. Here's my code: ...
0
votes
0answers
21 views

Remotely shutdown all computers on network running Ubuntu - bash scripting

I'm trying to iterate sudo poweroff through all ip addresses in my network using for loop. All computers in the network have the same password. sshpass -p password ssh $ip sudo poweroff The problem ...
0
votes
1answer
15 views

Apple Script: cannot call id3tag from script with “do shell script”

Trying to rename mp3s from an apple script which will be part of a larger script including Audio Hijacker. set folder_p to "/Users/me/Music/" set folder_path to POSIX path of folder_p set file_path ...
0
votes
1answer
19 views

Bash expands array where it should just use one element

My simple bash script to fetch images of a Raspberry Pi that are older than one minute: #!/bin/bash time=`date +"%FT%H_%M_%S"` imagedir="/root/pilapse/images/" files=`ssh pi find ...
0
votes
1answer
17 views

File Operations Using Symlink Source/Destination

I've created a set of symlinks which I can use in BASH with CDPATH: 'desk' which points to my desktop, and 'docs' which points to my documents. I can cd using these symlinks cd docs without problems, ...
0
votes
0answers
14 views

Alias command from terminal that opens a new terminal on a specific folder

I have this command already working in my .bash_profile: alias mysite='cd /Applications/sites/mysite;pwd; php artisan serve --port=9000 | open http://localhost:9000 | open -a Finder ./' So it: ...
0
votes
0answers
12 views

Default Profile

How can I set the default profile to be loaded on a bash login? My system was loading my user profile instead of the system one. I had it working properly and seemed to have accidentally broken it ...
0
votes
0answers
28 views

Most commands won't work on bash

So I updated to latest version of El Capitan (10.11.3) and adb stopped working for me. Upon messing with ~/.bash_profile, I made it worse and now most commands like open etc. won't work in terminal. I ...
0
votes
1answer
23 views

Vim E488 trailing characters but I don't see any trailing characters in file

Im opening the vimrc file with the following command vim ~/.bash_profile. Here's the error message and also the vim file contents. I actually get this error when ever I open any file with VIM. Error ...
0
votes
1answer
21 views

Bash 4.3 Substring Negative Length on OS X

Bash 4.2 added support for negative substring lengths: http://tldp.org/LDP/abs/html/abs-guide.html#SUBSTREXTR01 Example 37-12. Negative parameter in string-extraction construct When the ...
0
votes
0answers
10 views

Is it possible to automatically compile a LaTeX document through terminal using TeXworks?

I want to create an alias to automatically compile the main .tex file of a big document in LaTeX under Debian Wheezy. That means I need a shell command to do so. Is this possible? I am currently ...
0
votes
1answer
23 views

Quote a command for `find -execdir test [command]` (Bash)

I would like to execute following command to do git fetch in git repos if the have a remote (= git remote is non-empty): find -name .git -execdir test $(git remote) \; -execdir git fetch ...
0
votes
1answer
40 views

How can I tell bash top stop echoing text whenever I press any key?

I'm writing a custom startup command for gnome-terminal, and my intention is to display a welcome message every time I launch it. The message displays correctly, I coded it in order to make the ...
0
votes
1answer
34 views

Check if samba down from a Linux client

What is the most effective way to check Samba server availability from a Linux client?
0
votes
1answer
39 views

Is there a way to set up a warning before executing some commands in the terminal?

There are some terminal commands that are proficient at destroying large swaths of data very efficiently. Like: sudo rm -rf /* or rm -rf /*. I want to set up a warning that will show up, whenever ...
0
votes
2answers
22 views

Linux 'screen' command - Start a screen and something to run in it at the same time?

I'm a big fan of the linux program "screen" which allows me to start a screen within a SSH session which can stay alive after I disconnect. More info about screen here Is there a way I can start a ...
2
votes
1answer
28 views

Terminal not working properly

While I was messing around with stuff, I ran the commands: curl https://sdk.cloud.google.com | bash exec -l $SHELL gcloud components update dns gcloud auth login gcloud init After this, my bash ...
0
votes
0answers
17 views

Sed command to replace NUL character in file

I am using the command sed -i 's/\o000//g' filename or sed -i 's/\x0//g' filename to remove the NUL character but the command works fine in DEV environment but doesnt work in UAT. OS and sed version ...
0
votes
0answers
11 views

Fold on “short form of here document”

Apologies for the x-post from stackoverflow, but there appear to be views of [notepad++] here. According to the man ksh or man bash page (RHEL 6.6.0) <<< word is the equivalent of: ...
0
votes
1answer
20 views

bash: show names of background jobs in the bash prompt

It would be cool if the bash prompt can be used a a mini task bar. Can the bash prompt (PS1) show the names of the jobs listed in the jobs command?
1
vote
1answer
24 views

The “other” finger (GECOS fields at /etc/passwd)

in the file /etc/passwd we have the so called GECOS fields (which stands for "General Electric Comprehensive Operating System"), that is: username:password:userid:groupid:gecos:home-dir:shell ...
0
votes
2answers
24 views

bashrc alias ls not working

I'm trying to modify the ls command with an alias in my .bashrc file, and I'm getting some strange errors. .bashrc file export http_proxy="Some URL" export https_proxy=$http_proxy alias ls='ls ...
1
vote
1answer
27 views

for loop (f in *.txt) throws error if no *.txt file exists

I have a small bash script which looks something like this: #!/bin/sh for f in ./*.txt do f=$(basename $f) echo "Processing $f" scp somewhere mv $f done/`basename $f` done This is working ...
0
votes
1answer
26 views

How to save the result of a script into a text file? [closed]

I use the following command to grab the source of a front page, but I want to save it to a ".txt" file: osascript -e "tell application \"Safari\" to return the SOURCE of current tab of window 1" ...
1
vote
3answers
83 views

How to Copy all the .c files starting with letter [h-o] to directory h-oFiles

I'm trying to accomplish this one command and this is what I tried: sudo cp /hw2/ladsrc/.c[a-g] /hw2/a-gFiles What am I doing wrong here?
0
votes
0answers
22 views

source ~/.bashrc No command 'some' found, did you mean:

I just recently installed ubuntu 14.0.4 and I'm not sure why I can't source my ~/.bashrc. Whenever I issue source ~/.bashrc I get: No command 'some' found, did you mean: Command 'tome' from ...
3
votes
2answers
33 views

How to echo multiple lines?

I have such lines: server { listen 80; server_name $brand.mydomain.com; root /srv/www/clients/$brand/soon; } How could I append all those lines at once to the end of ...
1
vote
2answers
32 views

What is the maximum value of a numeric bash shell variable?

I'm curious as to what happens when a numeric variable in bash is incremented up without purposely stopping it. How large can the number get? Will it overflow and become negative and just continue to ...
0
votes
3answers
27 views

Show which command failed

command1 && command2 && echo "OK" || echo "FAIL" This will print OK if both commands succeeded or FAIL if either of commands failed. How can I modify this to print: OK if both ...
0
votes
1answer
22 views

Vagrant SSH & Nano on Linux Mint 17.3

I've recently installed Vagrant (1.7.4) and VirtualBox (5.0) on 3 laptops each running Linux Mint. Have reached a stage on all 3 where I need to edit a config file on the VM itself. So far, so good. ...
0
votes
0answers
15 views

Launch agent to run a .sh when it is added to a folder

I am trying to create a launch agent that will monitor a folder for when a .sh file has been added to it and run that .sh <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC ...
0
votes
0answers
15 views

Increase efficiency of bash loop with awk

I have to write a fairly large text file(>300,000 lines) using text extracted from the second column of one file, then prepending and appending text to each line and finally writing it out to a new ...
0
votes
0answers
23 views

Git Bash delayed output

I run some program in git bash terminal on windows and redirect output to grep to search for specific keywords. Problem is that the output is delayed, so it looks like the terminal waits for a chunk ...
1
vote
1answer
24 views

How to prevent “source” in a bash script from passing the script's arguments?

These questions address the functionality of source: What is the difference between executing a bash script and sourcing a bash script? What does 'source' do? but I'm confused as to why ...