#!/bin/bash
echo "select id='name1' method='out1'
option value='10'
option value='20'
option value='30'
select id='name2' method='out2'
option value='11'
option value='22'
option value='33'
select id='name3' method='out3'
option value='100'
option value='200'
option value='300'" | sed -rn "/select id='name2'/,/select/ s/option value='(.+)'/\1/p"
sysctl -w net.ipv4.ip_forward=1 # у вас уже сделано
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
#!/bin/bash
ALL_CHANGED_FILES='[
"monorepo/spfx-packages/news/src/webparts/news",
"monorepo/spfx-packages/news/config",
"monorepo/spfx-packages/news",
"monorepo/spfx-packages/news/src/webparts/news/loc",
"monorepo/spfx-packages/alert/src/webparts/alert",
"monorepo/spfx-packages/alert/config",
"monorepo/spfx-packages/alert",
"monorepo/spfx-packages/alert/src/webparts/alert/loc"
]'
echo "$ALL_CHANGED_FILES" | sed -rn 's@([^/]+/[^/]+/[^/]+)/.+@\1"@p' | sort -u | sed -r '$!s/.+/&,/'
cp -ra /root1/* /root2
echo 'deb http://mirror.yandex.ru/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://mirror.yandex.ru/debian/ bookworm main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb http://mirror.yandex.ru/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src http://mirror.yandex.ru/debian/ bookworm-updates main contrib non-free non-free-firmware' > /etc/apt/sources.list
#!/bin/bash
[ -x /usr/bin/rpmbuild ] || { echo 'rpmbuild not found'; exit 1; }
mkdir -p /tmp/rb
cd /tmp/rb
echo 'Name: testpackage
Version: 999
Release: 111
Summary: test summary
License: qwe
%description
test package
%install
cp $HOME/your_file %buildroot
%files
/your_file' > temp.spec
rpmbuild -v --target noarch --define "_topdir $PWD" -ba temp.spec
if checkLocationExists "$path"; then
echo ok
fi
#или
checkLocationExists "$path" && echo ok
#!/bin/bash
echo 'server {
location /test/v2.0.3 {
modsecurity on;
proxy_pass http://10.1.0.6:3000;
}
location /test/v2.0.0 {
modsecurity on;
proxy_pass http://10.1.0.6:3000;
}
}' | sed -r '\!^\s+location /test/v2.0.0 \{!,/^\s+\}$/ s/:3000;/:5555;/'