Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use grep -E instead of deprecated egrep #1308

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ If get_config,sh exists, please copy the output from (do in the top level libcoa
```
Else if using ./configure, please copy the output from (do in the top level libcoap directory) :-
```
cat config.log | egrep "result: | libcoap| host s" | cut -d\ -f3-
cat config.log | grep -E "result: | libcoap| host s" | cut -d\ -f3-
```
Else if using cmake, please copy the output from (do in the cmake build directory) :-
```
cmake -LH . | cut -d\ -f2- | egrep "\.\." | egrep "^[A-Z][A-Z]"
cmake -LH . | cut -d\ -f2- | grep -E "\.\." | grep -E "^[A-Z][A-Z]"
```
Else please copy the output from (do from within the libcoap directory) :-
```
Expand Down
8 changes: 4 additions & 4 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ man-page-build: upg-page-build man-page-start
##
for FILE in $${MAN_FILES} ; do \
BASE=`basename $${FILE} | cut -d. -f 1` ;\
MANUAL=`egrep -B 1 "^====" $${FILE} | head -1` ;\
SUMMARY=`egrep -B 2 "^SYNOPSIS" $${FILE} | ${SED} 's/coap-//g' | cut -d\- -f2 | cut -c2- | head -1` ;\
MANUAL=`${EGREP} -B 1 "^====" $${FILE} | head -1` ;\
SUMMARY=`${EGREP} -B 2 "^SYNOPSIS" $${FILE} | ${SED} 's/coap-//g' | cut -d\- -f2 | cut -c2- | head -1` ;\
if [ -z "$${SUMMARY}" ] ; then \
SUMMARY=`egrep -B 2 "^DESCRIPTION" $${FILE} | ${SED} 's/coap-//g' | cut -d\- -f2 | cut -c2- | head -1` ;\
SUMMARY=`${EGREP} -B 2 "^DESCRIPTION" $${FILE} | ${SED} 's/coap-//g' | cut -d\- -f2 | cut -c2- | head -1` ;\
fi ;\
##
## Fix and copy .html file across
Expand Down Expand Up @@ -126,7 +126,7 @@ man-page-build: upg-page-build man-page-start
echo ' <tab type="usergroup" visible="yes" url="@ref man_individual" title="Individual Man Pages">' >> $(top_builddir)/doc/insert_file ;\
for FILE in $${MAN3_FILES} ; do \
BASE=`basename $${FILE} | cut -d. -f 1` ;\
LIST=`${SED} -ne '/^NAME/,/^SYNOPSIS/p;/^SYNOPSIS/q' $${FILE} | ${SED} -ne '/coap_/{ s/ *, *//g ; p }' | egrep -v "^$${BASE}$$"` ;\
LIST=`${SED} -ne '/^NAME/,/^SYNOPSIS/p;/^SYNOPSIS/q' $${FILE} | ${SED} -ne '/coap_/{ s/ *, *//g ; p }' | ${EGREP} -v "^$${BASE}$$"` ;\
for ENTRY in $${LIST} ; do \
MANUAL="$${ENTRY}(3)" ;\
## Build the manual insert page
Expand Down
10 changes: 5 additions & 5 deletions examples/oscore_testcases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ timecheck () {

NO_PASS=0
NO_FAIL=0
# passfail count egrep-expression
# passfail count grep-expression
passfail () {
PASS=`cat /tmp/client_out | egrep "$2" | wc -l`
PASS=`cat /tmp/client_out | grep -E "$2" | wc -l`
if [ "$PASS" = "$1" ] ; then
echo Pass
let "NO_PASS=$NO_PASS+1"
Expand All @@ -139,7 +139,7 @@ passfail () {
if [ "$FULL_LOGS" = yes ] ; then
cat /tmp/client_out
elif [ "$PARTIAL_LOGS" = yes ] ; then
cat /tmp/client_out | egrep -v " DEBG | OSC "
cat /tmp/client_out | grep -E -v " DEBG | OSC "
fi
}

Expand All @@ -155,7 +155,7 @@ fi

if [ "$SERVERS_ONLY" = yes ] ; then
echo Servers are running, output in /tmp/server_b, /tmp/server_d, and /tmp/server_n
ps -ef | grep oscore-interop-server | egrep -v "grep "
ps -ef | grep oscore-interop-server | grep -E -v "grep "
exit 0
fi

Expand All @@ -165,7 +165,7 @@ rm -f /tmp/client_c

# Test 0 General checkout
echo -n "Test 0 - "
timecheck 10 $CLIENT -w -v8 coap://$TARGET_IP:$S_PORT_B/oscore/hello/coap 2>&1 | egrep -v " DEBG | OSC " > /tmp/client_out
timecheck 10 $CLIENT -w -v8 coap://$TARGET_IP:$S_PORT_B/oscore/hello/coap 2>&1 | grep -E -v " DEBG | OSC " > /tmp/client_out
passfail 1 "^Hello World"

# Test 1
Expand Down
6 changes: 3 additions & 3 deletions get_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ TAGS=0
if [ -f config.log ] ; then
echo "Last ./configure build"
echo ""
cat config.log | egrep " libcoap| host s" | cut -d\ -f7-
cat config.log | egrep "result: " | cut -d\ -f3- | cut -d\ -f7-
cat config.log | grep -E " libcoap| host s" | cut -d\ -f7-
cat config.log | grep -E "result: " | cut -d\ -f3- | cut -d\ -f7-
echo ""
TAGS=1
fi
for f in `find . -name CMakeCache.txt -print` ; do
DIR=`dirname $f`
echo "Last cmake build in $DIR"
echo ""
(cd $DIR ; cmake -LH . | cut -d\ -f2- | egrep "\.\." | egrep "^[A-Z][A-Z]")
(cd $DIR ; cmake -LH . | cut -d\ -f2- | grep -E "\.\." | grep -E "^[A-Z][A-Z]")
echo ""
TAGS=1
done
Expand Down
4 changes: 2 additions & 2 deletions man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ man7_MANS = $(MAN7)

.txt.3:
$(A2X) --doctype manpage --format manpage $<
@NEWLIST=`${SED} -ne '/^NAME/,/^SYNOPSIS/p;/^SYNOPSIS/q' $< | ${SED} 's/^- /\\\\\\\- /g' | egrep -v 'NAME|----|SYNOPSIS|^\$$' | tr '\n' ' '` ;\
@NEWLIST=`${SED} -ne '/^NAME/,/^SYNOPSIS/p;/^SYNOPSIS/q' $< | ${SED} 's/^- /\\\\\\\- /g' | ${EGREP} -v 'NAME|----|SYNOPSIS|^\$$' | tr '\n' ' '` ;\
NAME=`echo $< | ${SED} -ne 's/^\(coap_[a-zA-Z_0-9]\+\).*$$/\1.3/p'` ;\
${SED} -i '/.SH "NAME"/{n;d;}' $${NAME} ;\
${SED} -i "/\.SH \"NAME\"/a $${NEWLIST}" $${NAME}
$(A2X) --doctype manpage --format xhtml $<
@NEWLIST=`${SED} -ne '/^NAME/,/^SYNOPSIS/p;/^SYNOPSIS/q' $< | ${SED} 's^/^\\\\/^g' | egrep -v 'NAME|----|SYNOPSIS|^\$$' | tr '\n' ' '` ;\
@NEWLIST=`${SED} -ne '/^NAME/,/^SYNOPSIS/p;/^SYNOPSIS/q' $< | ${SED} 's^/^\\\\/^g' | ${EGREP} -v 'NAME|----|SYNOPSIS|^\$$' | tr '\n' ' '` ;\
NAME=`echo $< | ${SED} -ne 's/^\(coap_[a-zA-Z_0-9]\+\).*$$/\1.html/p'` ;\
${SED} -i "s^Name</h2><p>.*</p></div>^Name</h2><p>$${NEWLIST}</p></div>^" $${NAME}

Expand Down