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

learn more… | top users | synonyms

0
votes
1answer
9 views

CentOS6 Backup fails; “permission denied”

I am currently trying to do a backup of a server and am getting an error message when running my script. The script runs correctly on certain directories, but for the directory I am attempting to use ...
0
votes
1answer
32 views

How to handle a condition when an expect script executing another script on a remote host is interrupted?

Im using an expect script to say xyz.exp to login to a remote host and execute another script abc.sh Now most of the times abc.sh runs fine, but there is a scenario where if a certain condition is ...
0
votes
1answer
21 views

Running the command “bochs -q” from Cygwin fails

I'm having troubles to execute the command "bochs -q" from Cygwin. I have installed the XV6 operation system in my C drive. I'm using Cygwin in order to compile the XV6 files, that is execute the ...
0
votes
1answer
122 views

Require bash script to be run with sudo (not as root user)?

I want to require a bash script to be run as the current user with sudo, but prevent it from being run if it was executed as the root user directly. This is because I'm doing some setup actions for ...
0
votes
1answer
61 views

Unix Script: Wait until a file exists

I need a script that will wait for a (examplefile.txt) to appear in the /tmp directory and once it's found to stop the program, otherwise to sleep the file until it's located So far I have: if [ ! ...
0
votes
1answer
20 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 ...
0
votes
1answer
53 views

Bash Scrolling Output Cygwin

My apologies if this has been asked before but I did my best to find it beforehand. I have a bash script like so: #!/bin/sh <Appropriate variables here> lftp -c "open -p $port -u $login,$pass ...
0
votes
1answer
34 views

bash: find and zip all subfolders of a folder

how would one find all subfolders of a folder and zip them separately ? folder structure ./folder -subfolder_1 -subfolder_2 -subfolder_3 expected result: ./folder ...
0
votes
1answer
115 views

SSH into Homestead Using Git Bash on Windows Characters Not Displayed Properly

After running: homestead ssh and logging into the VM everything looks okay until you're typing certain commands or viewing command results where the characters aren't rendered properly so you get ...
0
votes
1answer
29 views

Which is the preferred approach to pass command/script arguments to a log file?

Generally, I am wondering how I can pass the arguments from a terminal command to stdout. More specifically, I am using tar as part of my backup process and I would like the parameters (especially ...
0
votes
1answer
34 views

Can I automatically run commands after Linux Mint Installation?

That's what I want: I want to run a bash file (composed mostly by apt-get's and instructions to download and install .deb files) just after, or during, Linux Mint installation. I've found many ...
0
votes
1answer
75 views

bash command in python not working

I would like to run a bash command from python. My code: process = subprocess.Popen(('ifconfig -s'), stdout=subprocess.PIPE, shell=True) output = process.communicate()[0] lcd.message(output) sleep(2) ...
0
votes
1answer
46 views

Use shell provided by non-root user

What is a good way for a non-root user to use an executable that is not in the system's list of shells as if it were the user's actual shell? I'm trying to do this with two different versions of ...
0
votes
1answer
18 views

Delete old backups alike Apple Time Machine does

Time Machine saves hourly backups for the past 24 hours, daily backups for the past month, and weekly backups for everything older than a month until the volume runs out of space. At that point, Time ...
0
votes
1answer
20 views

OS X LoginHook - nc exits prematurely for no apparent reason

I'm trying to use loginhook to download large amounts of data and I've been having problems which I've nailed down to nc exiting prematurely for no apparent reason. This is a simplified test script: ...
0
votes
1answer
46 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 ...
0
votes
1answer
36 views

Error while using sudo apt-get update

I am using ubuntu 12.04 and while using sudo apt-get update command I get this error: Hit http://in.archive.ubuntu.com precise-backports/universe Translation-en Fetched 4,683 kB in 1min 14s ...
0
votes
1answer
55 views

Open terminal with telnet from command

I'd like to open a telnet sessions from a sublime text build process. I've tried using open /bin/bash --args telnet 127.0.0.1 but that fails .. is there anything similar I can do? Edit I'm ...
0
votes
1answer
33 views

How to enable path folder in mac terminal

As You see when I put command "pwd" I'm in folder: MacBook-Grzeg% pwd /Users/Grzeg/ticket_managment But my terminal still show only that's: MacBook-Grzeg% Now as you can see I have ...
0
votes
1answer
26 views

CentOS bashrc function to email on login

I've a system setup where an email is sent on a user login (line from .bashrc): printf "user details, ip etc" | mail -s "[LOGIN NOTICE] `hostname` - `whoami`" <admin>@<domain>.co.uk ...
0
votes
1answer
55 views

while loop condition - search for string pattern in bash

I am altering a bash script and I need to write a loop and test if file of a specific pattern exists in source directory. Script works if I designate a specific file but not with a wild card ...
0
votes
1answer
94 views

windows 7 file explorer crashes after mkdir via git bash

My environment: Windows 7 Git v1.9.0 Steps to reproduce my problem: open a folder in windows explorer right click in that folder and select "Git Bash" execute: "mkdir test" in the git bash ...
0
votes
1answer
33 views

Run script under OSX _www user account

I have a small internal for my use only php website which triggers a bash script to do some app signing etc. I need that bash script to run some ruby gems. (Security is not important.) The way I see ...
0
votes
1answer
51 views

terminal previous history command overwrite characters

I have a weird behavior in my terminal (bash). When I CTRL-P, then try to insert some text at some position, the following characters overwritten. Not really overwritten but my terminal dont show ...
0
votes
1answer
23 views

Mac .bash_profile.save How to make it run by itself / where to actually change paths

trying to change my path for Ruby / SASS. I have always used a file in my home called '.bash_profile.save' In there I have the export paths which work fine but only when I run: source ...
0
votes
1answer
29 views

Is it possible to check for blips in internet using SSH tunnels?

So basically at work we're losing internet connectivity for just a few seconds at a time, which is enough to kill our SSH tunnels, kill our VoIP calls, etc. I have a cronjob set up with my own script ...
0
votes
1answer
18 views

Move spam emails from directory - bash script

I am trying to write bash script wich can cleanup my whoole server from spam emails that already are present in my client's folders. I would need this script to do, Check recursively directory ...
0
votes
1answer
21 views

Renaming a bunch of files by truncating at a certain point

I need to rename a bunch of music files from Artist - Title [FREE DL].mp3 and Artist - Title [FREE DL] [PREMIERE].mp3 to just Artist - Title.mp3 I have this, but it isn't working and I can't quite ...
0
votes
1answer
13 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 ...
0
votes
1answer
42 views

How can I configure the cancel button of dialog box bash?

How can I configure the cancel button of dialog box bash? It follows what I've done till now: dialog --backtitle "Dialog - Form sample" \ --form " Form Test - use [up] [down] to select input field ...
0
votes
1answer
25 views

'hhighlighter' wrapper script saying command not found

I have gotten the wrapper script 'hhighlighter' from https://github.com/paoloantinori/hhighlighter which colors anything you want in stdout. I followed the instructions about installing ack-grep, ...
0
votes
1answer
51 views

Ubuntu nested bash shell

Thanks for any help. I'm helping configure a machine to log keystrokes using /usr/bin/script function. For each session, a log file is created that includes the POSIX time. $PS1 is changed to reflect ...
0
votes
1answer
23 views

customizing mkisofs as cross-platform as possible

I have a relatively large archive from which my students would select files to create iso images, which they take home on their pen drives to burn their own DVDs. In order to make the process as ...
0
votes
1answer
6 views

accessing EC2 instance from cygwin

I should follow these instruction to connect to my EC2 instance with cygwin : $ cd ~ $ cp /cygdrive/c/Users/JohnSmith/Downloads/cs184-john-stanford-edu.pem . $ chgrp Users ...
0
votes
1answer
178 views

Shell script force stop without waiting for the exit code

I have written a shell script checklick.sh on my CentOS box with the following content: #!/bin/sh # # description: check link through rtmpdump # . /etc/rc.d/init.d/functions ...
0
votes
1answer
89 views

Damaged preference file in /bin/sh

Today in Drive Genius 3, I ran the “Verify Preferences” function in Repair. It yielded this strange result: /bin/sh: xargs: command not found The only option Drive Genius gives is to remove the ...
0
votes
1answer
33 views

Open file using bash with unix executable

I have an application which loads using a bash script e.g /Applications/My.app/Contents/MyExecutable I can load this using bash like so "/Applications/My.app/Contents/MyExecutable" However, I ...
0
votes
1answer
85 views

Difference between su and su -c (environment variables?) when running db2?

When I type this: su <user> -c "/home/<user>/sqllib/bin/db2 catalog tcpip node <dbName> remote <ip> server <port>" I get this error message: SQL10007N Message "-1390" ...
0
votes
1answer
367 views

Brew & Ruby no longer functioning properly due to a recursive trap

After updating to OS X 10.10 (Though this might have been irrelevant), I was not able to run any brew commands. Any command gave me this error: /usr/local/bin/brew: /usr/local/Library/brew.rb: ...
0
votes
1answer
264 views

Barnyard2 error on start

Been setting up a snort box with barnyard2, run into the error below. Can someone please help? $Starting Snort Output Processor (barnyard2): ./barnyard2: 35: ./barnyard2: barnyard2: not found ...
0
votes
1answer
128 views

How can I open a non-http URL (Chrome extension) in Google Chrome from the terminal in OS X?

I'm trying to add a shortcut to open Chrome with a non-http url from a bash script. This is what I've got: /usr/bin/open -a "/Applications/Google Chrome.app" ...
0
votes
1answer
44 views

Where do the variables of a new BASH shell come from?

I am puzzled as about how environment variables work. From what I am aware, for a new process to have some environment variables, its parent must have issued export. But what about all the variables ...
0
votes
1answer
120 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 ...
0
votes
1answer
35 views

Kill browser tabs with Bash from younger to older

Hello i want to kill tabs from a browser(ex. chromium) by order from youngest to oldest. I used pkill -f -n -9 chromium but i want to use it in a while iteration with comparison to pkill's return ...
0
votes
1answer
110 views

Awk script to run a command based on condition using 'if'

I have a piece of code here that basically takes a file called 'srcip' (which is just a list of IP addresses) and compares it to my '~/db' file which is just a tab delimited IP HOSTNAME database of ...
0
votes
1answer
41 views

Creating a macro with .sh

so I would like to write a script that will be used in the following way. ./MakeMacro 1 The basic form of the script looks like this: #!/bin/sh ...
0
votes
1answer
202 views

Is there a way to “source” a sh script from the fish shell?

I like to put many of my environment variable definitions in the .profile script. If I am using a POSIX-compatible interactive shell like bash, I can use the source command to re-export the ...
0
votes
1answer
54 views

Open an ssh session and pass a password on login

In the place where I live the internet connection basically works as follows: You have to configure your network interface to use a unique private ip and the organizations servers as gateway, which ...
0
votes
1answer
19 views

List folders by modification time of children in linux?

I have a folder, we'll call it /scripts/, that contains subfolders for a number of different scripts (let's say /scripts/file_export, /scripts/record_ingest, /scripts/stats). Inside these folders are ...
0
votes
1answer
312 views

How to install the debian bash-completion using homebrew?

I want bash to install bash command completion on my mac using brew.