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

learn more… | top users | synonyms

0
votes
0answers
29 views

Save rows effected from mysql delete statement in bash

I am trying to create a bash script that will connect to my database and purge older records, I would like to keep a record of the number of rows are deleted in a file (lets call it rowseffected.log). ...
0
votes
0answers
24 views

Capture user input to “kinit” - Works on OS X, but not Linux via “script”

I have a script that was written on OS X and utilizes the "script" command. With the -k flag it will log keys sent to the program, but that option is not available in the linux version of "script". My ...
0
votes
0answers
100 views

How to check via bash if your connection is wireless N/G/… on Linux?

iwlist scan shows me the available wireless connections. I can see Frequency:2.412 GHz for the channel I'm connected to. This article shows that a frequency of 2.412 GHz means that you are using ...
0
votes
0answers
14 views

(MAC) Change location of shell script's shell

When I make an executable shell script ("http://chimpy.wordpress.com/2010/08/29/mac-os-x-shortcut-link-to-python-script/", but without the python part), It's pointer location (The location commands ...
0
votes
0answers
31 views

open a new screen in linux, no access to perl local library

I added my perl local library to my shell startup script (.bashrc) and when I start a terminal in linux: $ echo $PERL5LIB /home/perl5/lib/perl5:/usr/share/vcftools/perl BUT when I open a new ...
0
votes
0answers
49 views

Mac OS X Terminal Error: undefined method `grep'

Every time I enter a command, or even just hit enter, in Terminal I get this line below the output: -e:1:in `<main>': undefined method `grep' for #<String:0x007feea31354b8> ...
0
votes
0answers
43 views

automatically prepend variable in for loop without having to put variable on each line

Is there a way to automatically have the $i variable prepended to the beginning of the command without having to specify it each time? Here is my current script. #!/bin/bash for i in "command ...
0
votes
0answers
52 views

Tmux causeing issues with Bash up-arrow

When using tmux, I have issues of ghost characters when using the Up and Down arrow keys in Bash. If I press UpArrow a few times and then press DownArrow a few times, then the first few characters of ...
0
votes
0answers
60 views

Error uncompressing file when piping curl to gunzip

I need to download a gzipped xml feed to parse in my Ruby app. It may well be quite large, 30Mb compressed, 300Mb uncompressed. So I do this: curl -s http://example.com/file.xml.gz | gunzip and read ...
0
votes
0answers
29 views

Why am I not receiving any system e-mails?

In my crontab, I have the following: * * * * * sh /home/rimmer/test.sh In /home/rimmer/test.sh I have the following: #!/bin/bash echo 'test'; I have also set chmod +x /home/rimmer/test.sh, of ...
0
votes
0answers
59 views

Bash, transforming a string list of words in a array

Sorry if I post a question on a topic discussed dozens of times. I'm trying to work on an element of an associative array and assign it to an array. I know that in bash associative arrays are ...
0
votes
0answers
15 views

Is there a way to enable either vim or emacs bindings for the tmux command buffer?

Normally, when we type a command to tmux, we do <Prefix>:, and get a line to type on at the bottom. Is there some option to set that command buffer to use either vi or emacs bindings for ...
0
votes
0answers
38 views

Bash MinGW ignoring Ctrl+O key combination

In Bash MinGW on Windows 7, I would like to use Ctrl+O to perform a history search backward. However, I can't get this work -- i.e., this line in my ~/.inputrc does nothing (although it does work on ...
0
votes
0answers
30 views

msysGit (Windows) and gpg-agent

Does anyone have a working setup to use gpg-agent in combination with msysGit on Windows? I have a setup for ssh-agent and it works fine but I can't get gpg-agent to work on Windows. I tried both a ...
0
votes
0answers
36 views

I'm trying to list size of folders plus selected files on a portable disk

For the purpose of finding the location of my data among many portable disks, I'm trying to create plaintext lists of the contents of all folders and files of certain extensions and sort them by size. ...
0
votes
0answers
72 views

Correct way of setting Ruby2.1 as the go-to application when it referenced to/called via shell?

I have installed Ruby 2.1 on my headless Debian server (7.4) by downloading the source from https://www.ruby-lang.org/en/downloads/ and then running the routine of ./configure make make install ...
0
votes
0answers
30 views

Exporting Variables – Reading Them Returns Blank?

Hi – I'm using Mac OS X (Mavericks), which should be UNIX compliant. In my .bash_login, I'm exporting variables for Cocos2D-X. I know this is executing, as I have a 'echo Test' line that executes ...
0
votes
0answers
44 views

Ubuntu: `env -i bash --norc`, but include essential variables such as HOME, DISPLAY? (where are these set?)

Is there an easy way to isolate a session of bash so that only essential variables (HOME, USER, DISPLAY, etc.) are preserved? (essential in that many programs fail if HOME, DISPLAY, TERM, SHELL, etc. ...
0
votes
0answers
39 views

How to restore virtual host configuration on Mac OSX

I successfully created some virtual hosts on my machine a while ago by modifying my /etc/hosts file and my http-vhosts.conf file. Then I found a very handy tool called virtualhost.sh ...
0
votes
0answers
65 views

Terminal: Multi-column/Table 'ls'

When running a fullscreen terminal, ls doesn't adapt to the current terminal width and supply me with multiple column-listings of items, it always provide a single column of directory items. Even ...
0
votes
0answers
20 views

Make synchronized folder with TFS in linux

I am using TFS every where on CentOS and I want to run a service to listen on directory modifying this directory represent TFS local folder and for every (add or modify) it mirroring to TFS I tried ...
0
votes
0answers
41 views

How to change definition of HERE DELIM in notepad++?

I am planning to document shell scripts with embedded Perl pod as explained here: http://bahut.alma.ch/2007/08/embedding-documentation-in-shell-script_16.html The problem is Notepad++ has a narrow ...
0
votes
0answers
41 views

Why does read's timeout break my console?

I have a script that is causing an issue, I've boiled it down to this; #/bin/bash read -t 1 -p 'Wanna continue?' less +F readTimeout.sh echo 'Wont get printed' The original script operated by ...
0
votes
0answers
33 views

Why can a non-root user not access Sublime soft link

I like using Sublime text as a VIM replacement i.e. opening from the terminal with an argument. I installed Sublime into /opt/sublime_text/ and within that is the executable I need. I then soft-linked ...
0
votes
0answers
90 views

Start X in fullscreen

I just installed Cygwin/X for the first time and found the documentation really lacking in noob-friendly details, it gives me command line options (like -fullscreen) but doesn't explain how to use ...
0
votes
0answers
64 views

Automated avconv recordings script

I'm currently recording video from my IP camera to disk by making use of avconv (ffmpeg). avconv -i rtsp://192.168.1.1/stream -c copy pool.mp4 This works great as my feeds are already h264, I ...
0
votes
0answers
45 views

How can my bash script inherit core limits from a C shell?

I'm using tcsh for my shell. I disable core dumps by running "limit core 0". Running a program that crashes from my shell, I can see that indeed no core dump is generated. Next I have a wrapper ...
0
votes
0answers
28 views

Set X11 to open scripts by default

I am really new to Mac as I don't own one. I have created a ruby script on windows that I like to open an a Mac. I would like to set X11 as default "program" to open scripts instead of the one ...
0
votes
0answers
36 views

How to close login shell (and children of that shell) after unclean SSH exit (e.g. closing PuTTY instance)

If PuTTY window is closed without explicitly ending the session, the login shell and subshells remain in the process tree (note the script.sh was running at the time SSH connection was dropped): user ...
0
votes
0answers
26 views

How do I determine whether a program other than bash is running in a different pane in tmux, and if so suspend it and return to the shell temporarily?

I am trying to write a bash script to script tmux and do things in every pane in my current window. That I have down, but I'd like to be able to know if another window is running the shell or if I'm ...
0
votes
0answers
80 views

automate drive mounting after Cisco AnyConnect client is connected

I have a request to write a bash script for clients to open VPN connection and automount remote drives. I am not sure how to approach it. I figured out I can use "vpncli.exe connect " to connect, but ...
0
votes
0answers
23 views

Checking to see if keycode is assigned in bashrc

I have recently added the following two lines to my .bashrc file: xmodmap -e "remove lock = Caps_Lock" xmodmap -e "keycode 66 = BackSpace" This remaps my caps lock key to delete every time I open a ...
0
votes
0answers
100 views

find files between dates and move to other directory

I have multiple logs file in one of the direcortories, was trying to move them monthly wise to another path. tried below script for the same. for Month in `seq -w 1 12`; do MLDAY=$(date -d ...
0
votes
0answers
43 views

Implement Roll-backing in bash script

I have implemented an Ubuntu package in which bash scripts are using. I followed these for making packages in Ubuntu. ...
0
votes
0answers
205 views

Why gnome-terminal does not show prompt in vnc running on a guest in kvm?

I use KVM to host vm (ubuntu). Then I started vnc4server on the vm. The content of ~/.vnc/xstartup is shown below. gnome-terminal in vnc does not show the prompt and doesn't accept any keyboard ...
0
votes
0answers
136 views

OSX : Find all zip and rar in a selected folder then unzip and unrar

I am in the process of cleaning a huge library of mangas (mostly -but not only- image files ). Each manga has a main folder containing the different volumes, sometimes in .zip, sometimes in .rar. ...
0
votes
0answers
66 views

Script bash start new process

Every time I run a bash script or a binary, it creates a new process and a messy display, the output text comes only when the process is done. I don't understand why it behaves this way, I would like ...
0
votes
0answers
23 views

IO performance over a period of time

We use AWS environment at our company and mainly we generate huge amount of data, and there are alot of I/O going on on several thousand files. A collegue is claiming that it looks like generating ...
0
votes
0answers
107 views

How can I customise grc (generic colouriser) with Homebrew?

I've installed grc through Homebrew on Mavericks. I can't quite understand the readme. What I want to do, for example, is have the terminal output colourise the number at the start of each line when I ...
0
votes
0answers
85 views

Find an xterm window by title, enter one command and press return using python/bash

I have an xterm window with a custom title. The xterm was fired up the following way: xterm -T customTitle I would like to enter a command (for example ls -l) into this xterm window from a ...
0
votes
0answers
60 views

Change all commands in custom application menu on Debian

so what I have is applications that's supposed to run as root, what I want to do is to add a sudo in the beginning of each command with a single bash script, so I can run these programs directly from ...
0
votes
0answers
56 views

Elaborating menu with bash scripts that use source

I got these two scripts, configScript.sh and genScript.sh, which works exactly as I want. configScript.sh sets up the options to use the next time I run genScript.sh in the shell. #!/bin/bash -x ...
0
votes
0answers
216 views

Automatically reconnect Openswan/IPSec VPN and disallow intermittent traffic?

I am trying to connect two Debian machines running an Openswan/IPSec tunnel. Also, I want to disallow any traffic when the tunnel goes down. For that purpose I wrote a script the fiddles with routes ...
0
votes
0answers
51 views

Special and diacritic charactres using less, cat and other linux tools

I am using GNU bash, Version 4.1.10(4)-release (i686-pc-cygwin) and set up my .inputrc to allow for special characters and German umlauts etc.: set meta-flag on set convert-meta off set output-meta ...
0
votes
0answers
107 views

save current VLC playlist from command line

I am looking for a way to save VLC's current playlist to a .m3u file from the linux bash terminal. I know I can do it from through the Media menu but would really like a command line option so that I ...
0
votes
0answers
85 views

How to easily execute last output line in bash?

You probably encuntered the case where a package was not installed and the system was recommending you to install it using apt-get install mypackage. I am looking for a quick keyboard shortcut for ...
0
votes
0answers
41 views

How to add additional charsets to libiconv in Cygwin

My problem is, that I sometimes have to convert files in the ISO646-DE-encoding (for german authorities... Don't ask...). On each linux-system that I used iconv -f ISO8859-1 -t ISO646-DE worked ...
0
votes
0answers
53 views

Linux flow control exit or break on condition

I have a query about the following flow control. I need help to run a script that has these three conditions: Conditions: Successful: Proceed to read message. Fails: Exit to cat or just exit ...
0
votes
0answers
124 views

BASH 4.2.45(1) - shopt direxpand breaks tab completion for ~

I have a machine with Mac OS X installed, running Bash 4.2.45(1). When I enable shopt direxpand, it works as expected, however when I try to do the following tab complete, the tab completion process ...
0
votes
0answers
50 views

Open a command inside of a new terminal window

I was wondering if there was any way to open a command inside of a new terminal window. That way I could, for instance, bind such a command to opening video files through my file manager and it would ...