From 502acb44c01a21fe4435d93ed59e1fe605441ac9 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sat, 15 Apr 2023 19:03:11 +0200 Subject: [PATCH] v-grep and v-sed --- bin/v-grep | 21 +++++++++++++++++++++ bin/v-sed | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 bin/v-grep create mode 100644 bin/v-sed diff --git a/bin/v-grep b/bin/v-grep new file mode 100644 index 000000000..3e4671296 --- /dev/null +++ b/bin/v-grep @@ -0,0 +1,21 @@ +#!/bin/bash +# info: calling myvesta_grep PHP function +# options: PARAMETERS +# +# The function is calling myVesta PHP replacement for GNU 'grep' command (but without regular expression) + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + + +if [ -p /dev/stdin ]; then + STDIN=$(cat -) + if [ ! -z "$STDIN" ]; then + echo "$STDIN" | php /usr/local/vesta/func/bash-to-php-interpreter.php 'myvesta_grep' "$@" + exit $? + fi +fi + +php /usr/local/vesta/func/bash-to-php-interpreter.php 'myvesta_grep' "$@" +exit $? diff --git a/bin/v-sed b/bin/v-sed new file mode 100644 index 000000000..9d1a82eeb --- /dev/null +++ b/bin/v-sed @@ -0,0 +1,21 @@ +#!/bin/bash +# info: calling myvesta_sed PHP function +# options: PARAMETERS +# +# The function is calling myVesta PHP replacement for GNU 'sed' command (but without regular expression) + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + + +if [ -p /dev/stdin ]; then + STDIN=$(cat -) + if [ ! -z "$STDIN" ]; then + echo "$STDIN" | php /usr/local/vesta/func/bash-to-php-interpreter.php 'myvesta_sed' "$@" + exit $? + fi +fi + +php /usr/local/vesta/func/bash-to-php-interpreter.php 'myvesta_sed' "$@" +exit $?