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:
parent
075c5e231b
commit
502acb44c0
21
bin/v-grep
Normal file
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
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 $?
|
Loading…
x
Reference in New Issue
Block a user