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"
}
Also in Shell:
- shell count number of lines
- git file history
- install pip3
- xampp linux
- grub file path
- how to get ssh access to a computer
- check changes after git pull
- direnv
- clear ram linux
- : sudo apt install apache2
- git go to previous branch
- matplotlib change he yticks to two number after digit
- check vm ram details in linux
- add git user and email
- git log one line
- install deno
- checking if a substring exists in a string bash
- set feh wallpaper
- how to install blender 2.8 from a ubuntu linux terminal
- git config --global credential.helper osxkeychain
- Git Commands: Step By Step Guide (Part 1)
- could not connect to server: Connection refused Is the server running on host and accepting TCP/IP connections on port 5432?
- dns_probe_finished_nxdomain linux ubuntu
- msdos dir for subdirectories