#!/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/.+/&,/'
#!/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
a='text / 2022 / 2021 / text / 2019 / ( 2018)'
a=${a//\/} # удаление /
a=${a// /_} # замена пробелов на _
password=`tr -dc 'A-Za-z0-9!@#$%&*()?/\\\[\]\{\}\-+_=<>.,' < /dev/urandom | head -c16`