Skip to content

Commit d8f5f5e

Browse files
authored
Remove unnecessary escapes of / in grep pattern (#6551)
Fixes warnings like: grep: warning: stray \ before / Signed-off-by: Keith W. Campbell <[email protected]>
1 parent 8e71d84 commit d8f5f5e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

terminateTestProcesses.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if [ "$OS" = "Windows_NT" ]; then
2424
not CommandLine like '%grep%'"
2525

2626
count=`powershell -c "(Get-WmiObject Win32_Process -Filter {${ignore_str} and ${match_str}} | measure).count" | tr -d "\\\\r"`
27-
27+
2828
if [ $count -gt 0 ]; then
2929
echo Windows rogue processes detected, attempting to stop them..
3030
powershell -c "Get-WmiObject Win32_Process -Filter {${ignore_str} and ${match_str}}"
@@ -35,7 +35,7 @@ if [ "$OS" = "Windows_NT" ]; then
3535
if [ $count -gt 0 ]; then
3636
echo "Cleanup failed, ${count} processes still remain..."
3737
exit 127
38-
fi
38+
fi
3939
echo "Processes stopped successfully"
4040
else
4141
echo Woohoo - no rogue processes detected!
@@ -59,13 +59,13 @@ else
5959

6060
LINUX_DOCKER_FILTER=""
6161
if [ `uname` = "Linux" ]; then
62-
if egrep "\/docker\/" /proc/1/cgroup >nul; then
62+
if egrep "/docker/" /proc/1/cgroup >nul; then
6363
echo Running in a Linux docker container
6464
else
6565
echo Running on a Linux host
6666
# Filter any possible docker container processes by cgroup containing "/docker"
6767
PSCOMMAND="ps -o cgroup,pid,state,tname,time,command -u $1"
68-
LINUX_DOCKER_FILTER="| egrep -v '^[^[:space:]]+\/docker'"
68+
LINUX_DOCKER_FILTER="| egrep -v '^[^[:space:]]+/docker'"
6969
fi
7070
fi
7171

@@ -91,4 +91,3 @@ else
9191
fi
9292

9393
exit 0
94-

0 commit comments

Comments
 (0)