mirror of
https://github.com/myvesta/vesta.git
synced 2024-11-03 04:00:20 -08:00
28 lines
841 B
Bash
28 lines
841 B
Bash
#!/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 [ "$1" == "--stdin" ] && [ -p /dev/stdin ]; then
|
|
STDIN=$(cat -)
|
|
if [ ! -z "$STDIN" ]; then
|
|
shift;
|
|
echo "$STDIN" | php /usr/local/vesta/func/bash-to-php-interpreter.php '--stdin' 'myvesta_sed' "$@"
|
|
exit $?
|
|
fi
|
|
fi
|
|
|
|
if [ "$1" == "--stdin" ]; then
|
|
shift;
|
|
php /usr/local/vesta/func/bash-to-php-interpreter.php '--stdin' 'myvesta_sed' "$@"
|
|
else
|
|
php /usr/local/vesta/func/bash-to-php-interpreter.php 'myvesta_sed' "$@"
|
|
fi
|
|
exit $?
|