Skip to content
Snippets Groups Projects
Commit 0ab16cb8 authored by Morris Jobke's avatar Morris Jobke
Browse files

Replace `replace` with `sed` statement

parent de8c15e1
No related branches found
No related tags found
No related merge requests found
Showing with 12 additions and 17 deletions
...@@ -23,7 +23,7 @@ echo "Fetch recent morrisjobke/docker-proftpd docker image" ...@@ -23,7 +23,7 @@ echo "Fetch recent morrisjobke/docker-proftpd docker image"
docker pull morrisjobke/docker-proftpd docker pull morrisjobke/docker-proftpd
# retrieve current folder to place the config in the parent folder # retrieve current folder to place the config in the parent folder
thisFolder=`echo $0 | replace "env/start-ftp-morrisjobke.sh" ""` thisFolder=`echo $0 | sed 's#env/start-ftp-morrisjobke\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -23,7 +23,7 @@ echo "Fetch recent atmoz/sftp docker image" ...@@ -23,7 +23,7 @@ echo "Fetch recent atmoz/sftp docker image"
docker pull atmoz/sftp docker pull atmoz/sftp
# retrieve current folder to place the config in the parent folder # retrieve current folder to place the config in the parent folder
thisFolder=`echo $0 | replace "env/start-sftp-atmoz.sh" ""` thisFolder=`echo $0 | sed 's#env/start-sftp-atmoz\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -23,7 +23,7 @@ echo "Fetch recent silvershell/samba docker image" ...@@ -23,7 +23,7 @@ echo "Fetch recent silvershell/samba docker image"
docker pull silvershell/samba docker pull silvershell/samba
# retrieve current folder to place the config in the parent folder # retrieve current folder to place the config in the parent folder
thisFolder=`echo $0 | replace "env/start-smb-silvershell.sh" ""` thisFolder=`echo $0 | sed 's#env/start-smb-silvershell\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# retrieve current folder to place the config in the parent folder # retrieve current folder to place the config in the parent folder
thisFolder=`echo $0 | replace "env/start-smb-windows.sh" ""` thisFolder=`echo $0 | sed 's#env/start-smb-windows\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -26,7 +26,7 @@ echo "Fetch recent morrisjobke/owncloud docker image" ...@@ -26,7 +26,7 @@ echo "Fetch recent morrisjobke/owncloud docker image"
docker pull morrisjobke/owncloud docker pull morrisjobke/owncloud
# retrieve current folder to place the config in the parent folder # retrieve current folder to place the config in the parent folder
thisFolder=`echo $0 | replace "env/start-webdav-ownCloud.sh" ""` thisFolder=`echo $0 | sed 's#env/start-webdav-ownCloud\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -17,7 +17,7 @@ fi ...@@ -17,7 +17,7 @@ fi
echo "Docker executable found - stop and remove docker containers" echo "Docker executable found - stop and remove docker containers"
# retrieve current folder to remove the config from the parent folder # retrieve current folder to remove the config from the parent folder
thisFolder=`echo $0 | replace "env/stop-ftp-morrisjobke.sh" ""` thisFolder=`echo $0 | sed 's#env/stop-ftp-morrisjobke\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -17,7 +17,7 @@ fi ...@@ -17,7 +17,7 @@ fi
echo "Docker executable found - stop and remove docker containers" echo "Docker executable found - stop and remove docker containers"
# retrieve current folder to remove the config from the parent folder # retrieve current folder to remove the config from the parent folder
thisFolder=`echo $0 | replace "env/stop-sftp-atmoz.sh" ""` thisFolder=`echo $0 | sed 's#env/stop-sftp-atmoz\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -17,7 +17,7 @@ fi ...@@ -17,7 +17,7 @@ fi
echo "Docker executable found - stop and remove docker containers" echo "Docker executable found - stop and remove docker containers"
# retrieve current folder to remove the config from the parent folder # retrieve current folder to remove the config from the parent folder
thisFolder=`echo $0 | replace "env/stop-smb-silvershell.sh" ""` thisFolder=`echo $0 | sed 's#env/stop-smb-silvershell\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# retrieve current folder to remove the config from the parent folder # retrieve current folder to remove the config from the parent folder
thisFolder=`echo $0 | replace "env/stop-smb-windows.sh" ""` thisFolder=`echo $0 | sed 's#env/stop-smb-windows\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -17,7 +17,7 @@ fi ...@@ -17,7 +17,7 @@ fi
echo "Docker executable found - stop and remove docker containers" echo "Docker executable found - stop and remove docker containers"
# retrieve current folder to remove the config from the parent folder # retrieve current folder to remove the config from the parent folder
thisFolder=`echo $0 | replace "env/stop-webdav-ownCloud.sh" ""` thisFolder=`echo $0 | sed 's#env/stop-webdav-ownCloud\.sh##'`
if [ -z "$thisFolder" ]; then if [ -z "$thisFolder" ]; then
thisFolder="." thisFolder="."
......
...@@ -32,11 +32,6 @@ if ! [ -x "$PHPUNIT" ]; then ...@@ -32,11 +32,6 @@ if ! [ -x "$PHPUNIT" ]; then
exit 3 exit 3
fi fi
if ! which replace > /dev/null 2>&1; then
echo "The command 'replace' is not available on this system. Please install it first." >&2
exit 5
fi
PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2) PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2)
PHPUNIT_MAJOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f1) PHPUNIT_MAJOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f1)
PHPUNIT_MINOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f2) PHPUNIT_MINOR_VERSION=$(echo $PHPUNIT_VERSION | cut -d"." -f2)
...@@ -181,7 +176,7 @@ EOF ...@@ -181,7 +176,7 @@ EOF
FILES_EXTERNAL_BACKEND_ENV_PATH=../apps/files_external/tests/env FILES_EXTERNAL_BACKEND_ENV_PATH=../apps/files_external/tests/env
for startFile in `ls -1 $FILES_EXTERNAL_BACKEND_ENV_PATH | grep start`; do for startFile in `ls -1 $FILES_EXTERNAL_BACKEND_ENV_PATH | grep start`; do
name=`echo $startFile | replace "start-" "" | replace ".sh" ""` name=`echo $startFile | sed 's/start-//' | sed 's/\.sh//'`
if [ -n "$2" -a "$2" != "$name" ]; then if [ -n "$2" -a "$2" != "$name" ]; then
echo "skip: $startFile" echo "skip: $startFile"
...@@ -211,7 +206,7 @@ EOF ...@@ -211,7 +206,7 @@ EOF
fi fi
# calculate stop file # calculate stop file
stopFile=`echo "$startFile" | replace start stop` stopFile=`echo "$startFile" | sed 's/start/stop/'`
echo "stop: $stopFile" echo "stop: $stopFile"
if [ -f $FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile ]; then if [ -f $FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile ]; then
# execute stop file if existant # execute stop file if existant
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment