Код: Выделить всё
cmd = 'findmnt --kernel /tmp | grep nosuid 2>/dev/null'
Sbp = subprocess.call(cmd ,
shell=True,
executable="/bin/bash",
text=True)
Код: Выделить всё
grep -Eis "(\\\v|\\\r|\\\m|\\\s|$(grep \'^ID=\' /etc/os-release | cut -d= -f2 | sed -e \'s/\"//g\'))\" /etc/motd 2>/dev/null
Я бы сказал, я пытаюсь найти аналог PowerShell Here-string или ScriptBlock. Пример в Powershell:
Код: Выделить всё
$cmd = @'
grep -Eis "(\\\v|\\\r|\\\m|\\\s|$(grep \'^ID=\' /etc/os-release | cut -d= -f2 | sed -e \'s/\"//g\'))\" /etc/motd 2>/dev/null
'@
Код: Выделить всё
$ScriptBlock = {grep -Eis "(\\\v|\\\r|\\\m|\\\s|$(grep \'^ID=\' /etc/os-release | cut -d= -f2 | sed -e \'s/\"//g\'))\" /etc/motd 2>/dev/null}
Подробнее здесь: https://stackoverflow.com/questions/790 ... sh-scripts