Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

sudo msys2

escape()
{
    RESULT="$1"
    RESULT="${RESULT/'/''}" # replace ' with ''
    RESULT="${RESULT/"/\"}" # replace " with "
    echo "''$RESULT''" # PowerShell uses '' to escape '
}

sudo()
{
    ESCAPED=()
    for ARG in "$@"
    do
        ESCAPED+=($(escape "$ARG"))
    done

    SHELL_PATH=$(cygpath -w $SHELL)
    PS_COMMAND="[Console]::In.ReadToEnd() | Start-Process '$SHELL_PATH' '-c -- "${ESCAPED[*]}"' -Verb RunAs"
    cat /dev/stdin | powershell -NoProfile -ExecutionPolicy Bypass "$PS_COMMAND"
}
Comment

PREVIOUS NEXT
Code Example
Shell :: dos search include subdirectories 
Shell :: pick yarn version 
Shell :: how to install and update git mac terminal 
Shell :: Não é possível excluir uma partição protegida sem o parâmetro de proteção forçada definido. 
Shell :: linux find files without string 
Shell :: install lutris ubuntu 20.04 
Shell :: windows 10 direct inbound port to another device 
Shell :: asdf node fingerprint 
Shell :: how to ushow to add hadolint as a pre-commit hook 
Shell :: osp it digital solutions 
Shell :: wget -v usage 
Shell :: sed subgroup pattern replace 
Shell :: how to clear/delete/remove/erase/wipe/forget shell traps 
Shell :: remove deb repository 
Shell :: adb install_failed_already_exists 
Shell :: what is tmux attach windows 
Shell :: open folder with cli 
Shell :: brownie run script python 
Shell :: grep show location 
Shell :: cmd echo datetime in loop 
Shell :: windows cmd "head -n " equivalent 
Shell :: kubernetes pending loadballancer 
Shell :: grep stack overflow 
Shell :: include buymeacoffewe butto in github README 
Shell :: push existing repository in gthub 
Shell :: Run Apache as Separate user and group 
Shell :: cara stop running docker 
Shell :: transmission permission denied 
Shell :: https local 
Shell :: checkra1 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =