]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
bash_aliases: Remove grep_syscall(), grep_syscall_def(), and grep_glibc_prototype()
authorAlejandro Colomar <alx@kernel.org>
Tue, 22 Nov 2022 19:38:26 +0000 (20:38 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 22 Nov 2022 19:38:30 +0000 (20:38 +0100)
The functionality of those shell functions is covered by the grepc(1)
program: <http://www.alejandro-colomar.es/src/alx/alx/grepc.git/>.

The program has several bug fixes that these shell functions didn't
receive.  It also has more useful features.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
scripts/bash_aliases

index f325542f8d2bc6fb9a47fe199611baef1003171f..9f7d10409361c14eda4a5a13c9431a17397b3be4 100644 (file)
@@ -34,60 +34,6 @@ sed_rm_ccomments()
        |sed 's%//.*%%';
 }
 
-########################################################################
-#      Linux kernel
-
-#  grep_syscall()  finds the prototype of a syscall in the kernel sources,
-# printing the filename, line number, and the prototype.
-# It should be run from the root of the linux kernel source tree.
-# Usage example:  .../linux$ grep_syscall openat2;
-#
-# See also: grepc(1)
-
-grep_syscall()
-{
-       if [ $# -ne 1 ]; then
-               >&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
-               return $EX_USAGE;
-       fi
-
-       find ./* -type f \
-       |grep '\.c$' \
-       |xargs grep -l "$1" \
-       |sort \
-       |xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\($1\b.*?\)" \
-       |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-
-       find ./* -type f \
-       |grep '\.[ch]$' \
-       |xargs grep -l "$1" \
-       |sort \
-       |xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_$1\s*\(.*?\)" \
-       |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-}
-
-#  grep_syscall_def()  finds the definition of a syscall in the kernel sources,
-# printing the filename, line number, and the function definition.
-# It should be run from the root of the linux kernel source tree.
-# Usage example:  .../linux$ grep_syscall_def openat2;
-#
-# See also: grepc(1)
-
-grep_syscall_def()
-{
-       if [ $# -ne 1 ]; then
-               >&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
-               return $EX_USAGE;
-       fi
-
-       find ./* -type f \
-       |grep '\.c$' \
-       |xargs grep -l "$1" \
-       |sort \
-       |xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\($1\b.*?^}" \
-       |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-}
-
 ########################################################################
 #      Linux man-pages
 
@@ -203,29 +149,3 @@ man_gitstaged()
        |tr -d '\n'                                                     \
        |sed 's/, $//'
 }
-
-########################################################################
-#      Glibc
-
-#  grep_glibc_prototype()  finds a function prototype in the glibc sources,
-# printing the filename, line number, and the prototype.
-# It should be run from the root of the glibc source tree.
-# Usage example:  .../glibc$ grep_glibc_prototype printf;
-#
-# See also: grepc(1)
-
-grep_glibc_prototype()
-{
-       if [ $# -ne 1 ]; then
-               >&2 echo "Usage: ${FUNCNAME[0]} <func>";
-               return $EX_USAGE;
-       fi
-
-       find ./* -type f \
-       |grep '\.h$' \
-       |xargs grep -l "$1" \
-       |sort \
-       |xargs pcregrep -Mn \
-         "(?s)^[\w[][\w\s(,)[:\]]+\s+\**$1\s*\([\w\s(,)[\]*]+?(...)?\)[\w\s(,)[:\]]*;" \
-       |sed -E 's/^[^:]+:[0-9]+:/&\n/';
-}