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

8
votes
0answers
122 views

How Stephane found Shellshock

This question is a bit unusual, because by definition there is only one person on the planet who can answer it. Since Stephane is a user here, and he found the Shellshock bug, I'd be interested (and ...
3
votes
0answers
60 views

can we use something better than more for tab completion?

more is not as convenient as less. Is it possible to use something better than more for tab completion, when ls and then tab? Thanks.
3
votes
0answers
46 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
30 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
177 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
44 views

Why do some processes pass on their cpu usage to another process when it ends?

I have wondered this for a while. For example, lets say process1 is a process that uses a lot of cpu power, like 90%. Its a video game. Then i have process2 which uses 10-12% cpu. Its a web browser. ...
2
votes
0answers
16 views

git report moved lines

I want to track the number of additions and deletions that exclude moved lines. So if a commit has 10 additions, 5 deletions, and 3 moved lines, then I have 7 additions, 2 deletions excluding moved ...
2
votes
0answers
33 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
36 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
119 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
78 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
816 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
80 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
84 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
56 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
176 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
315 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
1k 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
102 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
71 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
303 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
182 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
286 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
314 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
46 views

export -f in .bashrc after upgrade to bash 4.3.30 kills builtins?

I recently upgraded my bash (Mac OS X 10.6.8) from 3.2.48(1) to 4.3.30(1) via macports, and while the install seems to have gone smoothly, the two spots in my ~/.bashrc where I had export -f myfunc; ...
1
vote
0answers
14 views

How do I recursively apply default ACLs of a directory to its descendants?

If I have a directory with default ACL entries assigned to it, but some or all of its descendant files and sub-directories have access or default ACLs that do not agree with those defaults, how do I ...
1
vote
0answers
38 views

Maintain screen session when executing shell script on boot

On Ubuntu 14.04, I have a crontab entry set to run on reboot: @reboot /root/start_server.sh And here's start_server.sh: screen -dmS server bash -c "cd server ; ./run.sh" When the system starts ...
1
vote
0answers
37 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
133 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
123 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
65 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
51 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
27 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
40 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
209 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
50 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
65 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
59 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
192 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
70 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
119 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
113 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
302 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
149 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
71 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
396 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
117 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 ...