Questions about bash only, as opposed to other Bourne/POSIX shells. For all Bourne/POSIX-style shells, use the /shell tag instead.

learn more… | top users | synonyms

5
votes
0answers
174 views

Bash inside Vim not working properly

In MacVim I'm using Conque to run bash commands inside Vim. I have a problem with the text navigation while using Conque. If I'm at the end of a line of text and press down Alt← I skip a word to the ...
3
votes
0answers
43 views

How to stop bash editing the history when I reuse and modify an entry?

Some instances of bash change the command history when you re-use and edit a previous command, others apparently don't. I've been searching and searching but can't find anything that says how to ...
3
votes
0answers
24 views

Errtrace and local

I am using the following script: #!/bin/bash -Eu trap 'echo Hi' ERR exit_failure() { echo "Hello, World!" return 1 } sub_failure() { res=$(exit_failure) } sub_failure It results in the ...
3
votes
0answers
146 views

bash does not autocomplete my command when using sudo?

I'm using SaltStack. I would like to auto-complete the minion name when calling salt command. The following line has been added into ~/.bashrc: complete -o default -o nospace -W "$(sudo ls -1 ...
2
votes
0answers
20 views

How do I execute a program in Xfce and make it use another xfwm4 theme other than the default one?

I want to run a python script (the one in the answer to Python - how to make transparent window with gtk.Window but not with Gtk.) that displays a transparent window. I'm running it from a bash script ...
2
votes
0answers
27 views

Bash tab completion fails inside of command substitution

I've been using kill $(pidof ) to terminate programs for a while, and since last night, every time I try to use tab completion inside the $() it throws an error, bash: unexpected EOF while looking ...
2
votes
0answers
112 views

Securing a script a little more

I currently have the following script which works fine: #!/bin/sh user="$(zenity --entry --title="Username" --text="Username")" pass="$(zenity --password --title="Password" --text="Password")" ...
2
votes
0answers
64 views

Bash tabcomplete file names for environmental variable values

After I upgraded my Ubuntu from 12.04 to 14.04, bash would no longer let me tabcomplete file names when setting the value of an environmental variable, e.g. FILE=/home/_ _ is where I would press ...
2
votes
0answers
662 views

How to use rsync with GNU parallel?

I am using scp to copy the files in parallel using GNU parallel with my below shell script and it is working fine. I am not sure how can I use rsync in place of scp in my below shell script. I am ...
2
votes
0answers
75 views

“Debugging” with bashdb: why do I lose command echo after stepping into a simple script?

I heard about the bash debugger ( bashdb ) after reading a comment so I thought I should try it out and see if it can help me analyze bash scripts or more generally the execution of commands. There ...
2
votes
0answers
67 views

gnome “switch user” shortcut or command line

Is it possible to switch user of gnome desktop environment by single command or any shortcut key, in centos 6.0, or Can we create shortcut key? I found "fusa", but still unable to install it.
2
votes
0answers
54 views

Batch mv cronjob leaving some (not all) copies in source

I have a cronjob that runs every 5 minutes, looking for wavs and mp3s of the same name in a source directory and if it finds a corresponding pair, it moves both to a destination directory. The script ...
2
votes
0answers
145 views

tty blinking cursor not at insertion point

I have an Ubuntu 12.04 system where I, at reboot, login a root. This morning I did the things I had to and thought about running apt-get -y upgrade I started typing this but before pressing Enter I ...
2
votes
0answers
295 views

exit code of grep in trap where the script is launched by upstart service

recently I encountered a problem in ubuntu upstart and trap in bash shell. I use ubuntu 12.04 the upstart script(/etc/init/player.conf) is: start on (local-filesystems and runlevel [2345]) stop on ...
2
votes
0answers
908 views

Script stops command in it with exit 0

When I write a bash script similar to this on RHEL 6, if [ "$2" = "" ] ; then echo vip.start: ERROR: no NIC specified echo vip.start: Need IP and base interface name exit 1 fi case "$1" ...
2
votes
0answers
94 views

variable name lost when tab completing to export an environment variable with a path

I'm trying to setup an environment variable using tab completion, e.g. snowch$ export JAVA_HOME=/usr/lib/jvm/java-6-oracle/ I used to be able to tab complete the folders after typing the export ...
2
votes
0answers
68 views

LXC apparmor profile limits executing scripts in /run/*

LXC is blocking a trusted container from running scripts in /run/*, how do I configure LXC to allow scripts to run here?
2
votes
0answers
297 views

A problem with mknod when logged in as root

I am trying to load a char device driver written by myself. To achieve this I use a modified bash script published on this site: http://www.makelinux.net/ldd3/chp-3-sect-2. Here is my version of the ...
2
votes
0answers
178 views

What is and how to use PS1 \#

I put this is .bashrc # colors NC="$(tput sgr0)" RED="$(tput setaf 1)" GREEN="$(tput setaf 2)" # etc ... PS1="\[$BROWN\]\u \[$CYAN\]#\# \[$PINK_BLD\]!\!\[$NC\] \[$BLUE\]\W: \[$NC\]" So deepo #50 ...
2
votes
0answers
280 views

What happens when you background a function which calls another function?

Question says it all on the tin. Can someone explain to me what goes on here ? I'm trying to find out how to background a process in a script that calls another function and reliably terminate it when ...
2
votes
0answers
307 views

Populate PS1 asynchronously

I have a few git svn related functions that see if I have to pull/push from/to the repository. My problem is that the functions I've wrote to gather these informations are too slow, I'd like to make ...
1
vote
0answers
30 views

tput command + how to locate dialog window on the top of the screen

Is it possible to use the tput command in order to place the dialog window on the top of the screen ? For example The following dialog command display the log is running by tail command dialog ...
1
vote
0answers
29 views

From a bash script, is there a way to get the keybinding for “Resize window”?

This question is related to another that I asked How do I execute a program in Xfce and make it use another xfwm4 theme other than the default one? However, I'm now trying to get an answer that will ...
1
vote
0answers
69 views

bash: /etc/bash.bashrc: Permission denied whenever I open a terminal

On Ubuntu 13.10, when I open a new terminal, I sometimes get the following output on the terminal: bash: /etc/bash.bashrc: Permission denied However, the permissions should be fine: >ls -l ...
1
vote
0answers
50 views

Cannot SSH after switching to Netgear router

I have Comcast Xfinity internet. When I was sent their Wifi router/Cable modem combo box, I was able to use SSH perfectly. However, since the Wifi from the box was weak, I decided to buy my own ...
1
vote
0answers
74 views

Load a background image or set the background color if Konsole/Shell is running SSH

I want to set my laptop to load an image in the shell's background or set the background color to red if I'm connected via SSH. How can this be done? With a bash function in .bashrc? I have: Set the ...
1
vote
0answers
58 views

How to start a process chain from the shell

Is it possible and if so how do I: Start a /bin/bash process that is not bound to a terminal from a terminal? Hence, a shell process that shows up in the process tree as init -- bash. (Shells ...
1
vote
0answers
42 views

When gnu parallel exit,my program also fail

I use gnu parallel to run a bash function. The function just contains the bash script to restart my program. At first, the restart is ok, but when the gnu parallel script exits, my program also fails. ...
1
vote
0answers
26 views

How to make netcat print colourful text?

on my Mac I have an peripheral that sends text data to localhost:2332. Some of them are coloured, like this: "\e[1;31mRed text here\e[m normal text here", I use nc loacal host to monitor the data ...
1
vote
0answers
28 views

Using X11 Displays through Terminal.app commands : generic mapping tools

I am trying to figure out why I can't use ghostscript or ghostview (or any other X11 applications) when I try to call them in the Terminal. I am using bash, and I also used Fink to get the packages I ...
1
vote
0answers
109 views

Can I change uuid for network interface in ifcfg-eth* using uuidgen?

I'm creating a script which configuration the network interfaces. The script which generates /etc/udev/rules.d/70-persistent-net.rules and names interfaces to my preference. In CentOS 6.5, my ...
1
vote
0answers
44 views

dialog and gauge + yesno widget

I'm trying an example of using a yesno widget into a gauge one. But it fails, the code is: #!/bin/bash PCT=0;i=0 ( while [[ $PCT -le 100 ]] do cat <<EOF XXX $PCT el % es ${PCT} XXX EOF for i ...
1
vote
0answers
63 views

Create global enviromental variable after boot

I know about /etc/profile and /etc/environment, but I would like to set a global environmental variable after boot and login. By global, I mean an environment variable that can be accessed by any ...
1
vote
0answers
54 views

Transparent encryption of bash history?

I'm not sure if anyone has done such things before. I want bash history to be fully encrypted, prompt for password when in interactive session. Is that possible?
1
vote
0answers
49 views

manipulate a Drush “internal” variable

I want to modify a variable (preferably in a Bash Script format) because my PHP environment requires a port number. To show a URL in Drush containing a token that logs you in as user 1 (without a ...
1
vote
0answers
185 views

Shell script to backup VMware VM's, exporting each VM to a list then asking user intput

What I'm Trying To Accomplish: Get list of Virtual Machines ".vmx" file and place in variables Give the user and choice of which VM to backup Use "ovftool" to produce an export of the chosen VM to ...
1
vote
0answers
63 views

Segmentation fault with dialog

I'm getting a segmentation fault with the following script when it's more that one child dir past the pwd. The program kills with the error message and I have to reset the shell. For example: I start ...
1
vote
0answers
113 views

Intercepting packets with bash

I'm wondering if it's possible to detect a packet that comes from certain IP and port(suppose IP 1.1.1.1 and port 80) and has some specific information on it (suppose "<h1>Web ...
1
vote
0answers
106 views

How can I reset the bash filename completion for “more”?

I've done something that has changed the way TAB auto-complete works, but only for the more command. Every other command lists the possible completions, but more now lists ALL of the possibilities ...
1
vote
0answers
56 views

Using alot MUA with nottoomuch-addresses

I try to use the MUA alot to work with the nottoomuch-addresses.sh script for autocompletion of addresses within alot like described in: ...
1
vote
0answers
55 views

Where is the default icon used by Gnome when no icons are found?

Just to experiment, I moved the folder /user/share/icons/ away, as in saved it on a USB drive and deleted it from Linux. Now, all icons are shown as the default "white" icon. Where is this icon ...
1
vote
0answers
259 views

gnome-terminal cmd leaving processes open after closing parent window

The following simple command should demonstrate my issue: gnome-terminal --tab -t "Tab 1" -e "/bin/bash" --tab -t "Tab 2" -e "/bin/bash" This should open a new window with two tabs and an active ...
1
vote
0answers
126 views

Modify .inputrc to fix Mac Terminal bug with vi mode

I currently have a bug in my Mac's Terminal (I actually use iTerm2 but it's still there), where once I press left arrow after typing, I can't go past the last character. Is there a way I can modify ...
1
vote
0answers
69 views

Themed Tabs in Gnome Terminal

I've created a custom desktop session which upon login presents the user with a full screen gnome-terminal session. The idea is to have a TTY-like session but with the added advantages provided by X ...
1
vote
0answers
363 views

Create adhoc network when disconnected from network

I am using ArchLinux and want to create an AdHoc network automatically when the connection to the home network drops (or the home network can't be connected to on startup). How can I achieve this? I ...
1
vote
0answers
109 views

rsstail Not Printing Output

I've installed rsstail 1.8 on my linux box and everything seems to be going smoothly, knock on wood, except for the part where rsstail isn't printing the streams. Running the command, I see that it's ...
1
vote
0answers
2k views

Using sshpass, return code (exit status) differs for reasons unknown using valid commands

There are a few things going on here but I think ultimately, either CLish or SSH is returning an exit code that is messing up my work flow. I'm attempting to connect to a remote machine (CLish shell) ...
1
vote
0answers
986 views

nscd uses 100% cpu

I'm working on a linux box and the output of top reveals that the command nscd (user nscd) is using 100% of CPU. I'm uploading a flat file to MySQL from this box, and it is taking a long time (albeit ...
1
vote
0answers
258 views

Why does this pipeline get SIGTTIN?

When I run the command for i in *.log; do cat "$i" | sort; done | more, the pipeline gets a SIGTTIN signal and is stopped. bash$ for i in *.log; do cat "$i" | sort; done | more ### (one screenful of ...
1
vote
0answers
388 views

How to use history commands with readonly PROMPT_COMMAND?

I'm sometimes logged in on a host which I do not control and where PROMPT_COMMAND is readonly. Is there some way to work around this to run history commands anyway, for example using PS1? I've tried ...