1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Add executable argument to dsh instead of assuming /bin/sh

This commit is contained in:
Joe Groocock 2017-02-22 10:31:18 +00:00
parent 2337f4e602
commit 24c2d29fce

View File

@ -161,7 +161,8 @@ alias dsh='_dsh exec'
alias drsh='_dsh "run --rm"'
_dsh() {
local dowhat="$1"
local user=`echo $2 | cut -d'@' -f1 -s`
local user=$(echo "$2" | cut -d'@' -f1 -s)
local prog="${@:3:$#}"
local usercmd=""
if [ -z "$user" ]; then
host="$2"
@ -170,7 +171,7 @@ _dsh() {
usercmd="--user=$user "
fi
eval "docker $dowhat -ti $usercmd$host /bin/sh"
eval "docker $dowhat -ti $usercmd$host $prog"
}
alias dm='docker-machine'