1
0
mirror of https://github.com/myvesta/vesta.git synced 2025-03-12 04:35:23 -07:00

v-grep and v-sed

This commit is contained in:
myvesta 2023-04-15 19:03:11 +02:00 committed by GitHub
parent 075c5e231b
commit 502acb44c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

21
bin/v-grep Normal file

@ -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 $?

21
bin/v-sed Normal file

@ -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 $?