mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
v-grep and v-sed
This commit is contained in:
parent
075c5e231b
commit
502acb44c0
2 changed files with 42 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue