Skip to content

Commit

Permalink
Merge branch 'elfmz:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
deep-soft authored Oct 13, 2023
2 parents 3fdb71a + 7b0615e commit 67fa8c2
Show file tree
Hide file tree
Showing 11 changed files with 334 additions and 245 deletions.
2 changes: 2 additions & 0 deletions NetRocks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ add_executable (NetRocks-SHELL
src/Protocol/SHELL/ProtocolSHELL_ExecCmd.cpp
src/Protocol/SHELL/WayToShellConfig.cpp
src/Protocol/SHELL/WayToShell.cpp
src/Protocol/SHELL/Request.cpp
src/Protocol/SHELL/Parse.cpp
src/Protocol/SHELL/RemoteSh.cpp
src/Protocol/ShellParseUtils.cpp
)

Expand Down
201 changes: 100 additions & 101 deletions NetRocks/src/Protocol/SHELL/Helpers/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ SHELLFCN_GET_INFO_INNER() {

else
SHELLVAR_SELECTED_LS_ARGS=$SHELLVAR_LS_ARGS
if [ -n "$2" ]; then
SHELLVAR_SELECTED_LS_ARGS=$SHELLVAR_LS_ARGS_FOLLOW
fi
[ -n "$2" ] && SHELLVAR_SELECTED_LS_ARGS=$SHELLVAR_LS_ARGS_FOLLOW
if [ -n "$5" ]; then
ls -d $SHELLVAR_SELECTED_LS_ARGS "$1" | grep $SHELLVAR_GREP_ARGS '^[^cbt]' | ( $SHELLVAR_READ_FN $5; echo $y )
else
Expand All @@ -66,97 +64,102 @@ SHELLFCN_GET_SIZE() {
}

SHELLFCN_GET_INFO() {
SHELLVAR_INFO=`SHELLFCN_GET_INFO_INNER "$@" 2>>$SHELLVAR_LOG`
if [ -n "$SHELLVAR_INFO" ]; then
echo "+OK:$SHELLVAR_INFO"
SHELLVAR_OUT=`SHELLFCN_GET_INFO_INNER "$@" 2>>$SHELLVAR_LOG`
if [ -n "$SHELLVAR_OUT" ]; then
echo "+OK:$SHELLVAR_OUT"
else
SHELLVAR_ERROR=`SHELLFCN_GET_INFO_INNER "$@" 2>&1`
echo "+ERROR:$SHELLVAR_ERROR"
SHELLVAR_OUT=`SHELLFCN_GET_INFO_INNER "$@" 2>&1`
echo "+ERROR:$SHELLVAR_OUT"
fi
}

SHELLFCN_CMD_ENUM() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH || exit
if [ -n "$SHELLVAR_STAT" ]; then
stat --format="$SHELLVAR_STAT_FMT" "$SHELLVAR_ARG_PATH"/* "$SHELLVAR_ARG_PATH"/.* 2>>$SHELLVAR_LOG
stat --format="$SHELLVAR_STAT_FMT" "$SHELLVAR_ARG"/* "$SHELLVAR_ARG"/.* 2>>$SHELLVAR_LOG
elif [ -n "$SHELLVAR_FIND" ]; then
find -H "$SHELLVAR_ARG_PATH" -mindepth 1 -maxdepth 1 -printf "$SHELLVAR_FIND_FMT" 2>>$SHELLVAR_LOG
find -H "$SHELLVAR_ARG" -mindepth 1 -maxdepth 1 -printf "$SHELLVAR_FIND_FMT" 2>>$SHELLVAR_LOG
else
ls $SHELLVAR_LS_ARGS_FOLLOW "$SHELLVAR_ARG_PATH" 2>>$SHELLVAR_LOG | grep $SHELLVAR_GREP_ARGS '^[^cbt]'
ls $SHELLVAR_LS_ARGS_FOLLOW "$SHELLVAR_ARG" 2>>$SHELLVAR_LOG | grep $SHELLVAR_GREP_ARGS '^[^cbt]'
fi
}

SHELLFCN_CMD_INFO_SINGLE() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH || exit
SHELLFCN_GET_INFO "$SHELLVAR_ARG_PATH" "$1" "$2" "$3" "$4"
SHELLFCN_GET_INFO "$SHELLVAR_ARG" "$1" "$2" "$3" "$4"
}

SHELLFCN_CMD_INFO_MULTI() {
# !!! This is a directory with symlinks listing bottleneck !!!
# TODO: Rewrite so instead of querying files one-by-one do grouped queries with one stat per several files
while true; do
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH || exit
[ ! -n "$SHELLVAR_ARG_PATH" ] && break
SHELLFCN_GET_INFO "$SHELLVAR_ARG_PATH" "$1" "$2" "$3" "$4"
while [ $SHELLVAR_ARG -gt 0 ]; do
$SHELLVAR_READ_FN SHELLVAR_PATH1 SHELLVAR_PATH2 SHELLVAR_PATH3 SHELLVAR_PATH4 SHELLVAR_PATH5 SHELLVAR_PATH6 SHELLVAR_PATH7 SHELLVAR_PATH8 || exit
[ $SHELLVAR_ARG -ge 1 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH1" "$1" "$2" "$3" "$4"
[ $SHELLVAR_ARG -ge 2 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH2" "$1" "$2" "$3" "$4"
[ $SHELLVAR_ARG -ge 3 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH3" "$1" "$2" "$3" "$4"
[ $SHELLVAR_ARG -ge 4 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH4" "$1" "$2" "$3" "$4"
[ $SHELLVAR_ARG -ge 5 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH5" "$1" "$2" "$3" "$4"
[ $SHELLVAR_ARG -ge 6 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH6" "$1" "$2" "$3" "$4"
[ $SHELLVAR_ARG -ge 7 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH7" "$1" "$2" "$3" "$4"
[ $SHELLVAR_ARG -ge 8 ] && SHELLFCN_GET_INFO "$SHELLVAR_PATH8" "$1" "$2" "$3" "$4"
SHELLVAR_ARG=`expr $SHELLVAR_ARG - 8`
done
}

SHELLFCN_CHOOSE_BLOCK() {
# $1 - size want to write
# $2 - position want to seek (so chosen block size will be its divider)
BLOCK=1
[ $1 -ge 16 ] && [ `expr $2 % 16` -eq 0 ] && BLOCK=16
[ $1 -ge 64 ] && [ `expr $2 % 64` -eq 0 ] && BLOCK=64
[ $1 -ge 512 ] && [ `expr $2 % 512` -eq 0 ] && BLOCK=512
[ $1 -ge 4096 ] && [ `expr $2 % 4096` -eq 0 ] && BLOCK=4096
[ $1 -ge 65536 ] && [ `expr $2 % 65536` -eq 0 ] && BLOCK=65536
SHELLVAR_BLOCK=1
[ $1 -ge 16 ] && [ `expr $2 % 16` -eq 0 ] && SHELLVAR_BLOCK=16
[ $1 -ge 64 ] && [ `expr $2 % 64` -eq 0 ] && SHELLVAR_BLOCK=64
[ $1 -ge 512 ] && [ `expr $2 % 512` -eq 0 ] && SHELLVAR_BLOCK=512
[ $1 -ge 4096 ] && [ `expr $2 % 4096` -eq 0 ] && SHELLVAR_BLOCK=4096
[ $1 -ge 65536 ] && [ `expr $2 % 65536` -eq 0 ] && SHELLVAR_BLOCK=65536
}

SHELLFCN_CMD_READ() {
$SHELLVAR_READ_FN OFFSET SHELLVAR_ARG_PATH || exit
SIZE=`SHELLFCN_GET_SIZE "$SHELLVAR_ARG_PATH"`
if [ ! -n "$SIZE" ]; then
$SHELLVAR_READ_FN SHELLVAR_OFFSET || exit
SHELLVAR_SIZE=`SHELLFCN_GET_SIZE "$SHELLVAR_ARG"`
if [ ! -n "$SHELLVAR_SIZE" ]; then
echo '+FAIL'
return
fi
SHELLVAR_STATE=
if [ -n "$SHELLVAR_DD" ]; then
while true; do
REMAIN=`expr $SIZE - $OFFSET`
SHELLVAR_REMAIN=`expr $SHELLVAR_SIZE - $SHELLVAR_OFFSET`
$SHELLVAR_READ_FN SHELLVAR_STATE || exit
if [ "$SHELLVAR_STATE" = 'abort' ]; then
echo '+ABORTED'
$SHELLVAR_READ_FN SHELLVAR_STATE || exit
break
fi
if [ $REMAIN -le 0 ]; then
if [ $SHELLVAR_REMAIN -le 0 ]; then
echo '+DONE'
$SHELLVAR_READ_FN SHELLVAR_STATE || exit
break
fi
SHELLFCN_CHOOSE_BLOCK $REMAIN $OFFSET
PIECE=$REMAIN
[ $PIECE -gt 8388608 ] && PIECE=8388608
CNT=`expr $PIECE / $BLOCK`
PIECE=`expr $CNT '*' $BLOCK`
echo '+NEXT:'$PIECE
dd iflag=fullblock skip=`expr $OFFSET / $BLOCK` count=$CNT bs=$BLOCK if="${SHELLVAR_ARG_PATH}" 2>>$SHELLVAR_LOG
SHELLFCN_CHOOSE_BLOCK $SHELLVAR_REMAIN $SHELLVAR_OFFSET
SHELLVAR_PIECE=$SHELLVAR_REMAIN
[ $SHELLVAR_PIECE -gt 8388608 ] && SHELLVAR_PIECE=8388608
CNT=`expr $SHELLVAR_PIECE / $SHELLVAR_BLOCK`
SHELLVAR_PIECE=`expr $CNT '*' $SHELLVAR_BLOCK`
echo '+NEXT:'$SHELLVAR_PIECE
dd iflag=fullblock skip=`expr $SHELLVAR_OFFSET / $SHELLVAR_BLOCK` count=$CNT bs=$SHELLVAR_BLOCK if="${SHELLVAR_ARG}" 2>>$SHELLVAR_LOG
ERR=$?
if [ $ERR -ne 0 ]; then
# its unknown how much data was actually read, so send $PIECE of zeroes followed with ERROR statement
# its unknown how much data was actually read, so send $SHELLVAR_PIECE of zeroes followed with ERROR statement
# unless its client aborted transfer by sending CtrlC
[ "$SHELLVAR_STATE" = 'abort' ] || dd iflag=fullblock count=$CNT bs=$BLOCK if=/dev/zero 2>>$SHELLVAR_LOG
[ "$SHELLVAR_STATE" = 'abort' ] || dd iflag=fullblock count=$CNT bs=$SHELLVAR_BLOCK if=/dev/zero 2>>$SHELLVAR_LOG
SHELLFCN_SEND_ERROR_AND_RESYNC "$ERR"
break
fi
OFFSET=`expr $OFFSET + $PIECE`
SHELLVAR_OFFSET=`expr $SHELLVAR_OFFSET + $SHELLVAR_PIECE`
done

elif [ $OFFSET -eq 0 ]; then
elif [ $SHELLVAR_OFFSET -eq 0 ]; then
# no dd? fallback to cat, if can
$SHELLVAR_READ_FN SHELLVAR_STATE || exit
echo '+NEXT:'$SIZE
cat "$SHELLVAR_ARG_PATH" 2>>$SHELLVAR_LOG
echo '+NEXT:'$SHELLVAR_SIZE
cat "$SHELLVAR_ARG" 2>>$SHELLVAR_LOG
echo '+DONE'
$SHELLVAR_READ_FN SHELLVAR_STATE || exit

Expand All @@ -170,16 +173,16 @@ SHELLFCN_WRITE_BY_DD() {
# $2 - offset
# $3 - file
SHELLFCN_CHOOSE_BLOCK $1 $2
DDCNT=`expr $1 / $BLOCK`
DDPIECE=`expr $DDCNT '*' $BLOCK`
DDSEEK=`expr $2 '/' $BLOCK`
dd iflag=fullblock seek=$DDSEEK count=$DDCNT bs=$BLOCK of="$3" 2>>$SHELLVAR_LOG
rv=$?
if [ $rv -eq 0 ] && [ $DDPIECE -ne $1 ]; then
SHELLFCN_WRITE_BY_DD `expr $1 - $DDPIECE` `expr $2 + $DDPIECE` "$3"
rv=$?
SHELLVAR_DDCNT=`expr $1 / $SHELLVAR_BLOCK`
SHELLVAR_DDPIECE=`expr $SHELLVAR_DDCNT '*' $SHELLVAR_BLOCK`
SHELLVAR_DDSEEK=`expr $2 '/' $SHELLVAR_BLOCK`
dd iflag=fullblock seek=$SHELLVAR_DDSEEK count=$SHELLVAR_DDCNT bs=$SHELLVAR_BLOCK of="$3" 2>>$SHELLVAR_LOG
RV=$?
if [ $RV -eq 0 ] && [ $SHELLVAR_DDPIECE -ne $1 ]; then
SHELLFCN_WRITE_BY_DD `expr $1 - $SHELLVAR_DDPIECE` `expr $2 + $SHELLVAR_DDPIECE` "$3"
RV=$?
fi
return $rv
return $RV
}

SHELLFCN_WRITE_BY_HEAD() {
Expand Down Expand Up @@ -218,33 +221,37 @@ SHELLFCN_WRITE_BY_BASE64() {
}

SHELLFCN_CMD_WRITE() {
$SHELLVAR_READ_FN OFFSET SHELLVAR_ARG_PATH || exit
$SHELLVAR_READ_FN SHELLVAR_OFFSET || exit
if [ -n "$SHELLVAR_DD" ] || [ -n "$SHELLVAR_HEAD" ] || [ -n "$SHELLVAR_BASE64" ]; then
SHELLFCN_WRITE=SHELLFCN_WRITE_BY_BASE64
[ -n "$SHELLVAR_HEAD" ] && SHELLFCN_WRITE=SHELLFCN_WRITE_BY_HEAD
[ -n "$SHELLVAR_DD" ] && SHELLFCN_WRITE=SHELLFCN_WRITE_BY_DD
if ! [ -n "$SHELLVAR_DD" ] && [ $OFFSET -ne 0 ] && ! truncate --size="$OFFSET" "$SHELLVAR_ARG_PATH" >>$SHELLVAR_LOG 2>&1 ; then
if ! [ -n "$SHELLVAR_DD" ] && [ $SHELLVAR_OFFSET -ne 0 ] && ! truncate --size="$SHELLVAR_OFFSET" "$SHELLVAR_ARG" >>$SHELLVAR_LOG 2>&1 ; then
SHELLFCN_SEND_ERROR_AND_RESYNC "$?"
# avoid futher writings
SHELLVAR_ARG_PATH=/dev/null
SHELLVAR_ARG=/dev/null
else
echo '+OK'
fi
NSEQ=1
while true; do
while true; do
$SHELLVAR_READ_FN SEQ SIZE || exit
[ "$SIZE" = '' ] || break
$SHELLVAR_READ_FN SEQ SHELLVAR_SIZE || exit
[ "$SHELLVAR_SIZE" = '' ] || break
done
[ "$SEQ" = '.' ] && break
if [ $NSEQ -eq $SEQ ] && $SHELLFCN_WRITE $SIZE $OFFSET "$SHELLVAR_ARG_PATH"; then
if [ "$SEQ" = '.' ]; then
# have to create/truncate file if there was no data written
[ $NSEQ -eq 1 ] && ( touch "$SHELLVAR_ARG"; truncate --size="$SHELLVAR_OFFSET" "$SHELLVAR_ARG" ) >>$SHELLVAR_LOG 2>&1
break
fi
if [ $NSEQ -eq $SEQ ] && $SHELLFCN_WRITE $SHELLVAR_SIZE $SHELLVAR_OFFSET "$SHELLVAR_ARG"; then
echo '+OK'
OFFSET=`expr $OFFSET + $SIZE`
SHELLVAR_OFFSET=`expr $SHELLVAR_OFFSET + $SHELLVAR_SIZE`
NSEQ=`expr $NSEQ + 1`
else
SHELLFCN_SEND_ERROR_AND_RESYNC "SEQ=$SEQ NSEQ=$NSEQ $?"
# avoid futher writings
SHELLVAR_ARG_PATH=/dev/null
SHELLVAR_ARG=/dev/null
fi
done
else
Expand All @@ -253,33 +260,29 @@ SHELLFCN_CMD_WRITE() {
}

SHELLFCN_CMD_REMOVE_FILE() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH || exit
unlink "$SHELLVAR_ARG_PATH" >>$SHELLVAR_LOG 2>&1 || rm -f "$SHELLVAR_ARG_PATH" >>$SHELLVAR_LOG 2>&1
SHELLVAR_OUT=`unlink "$SHELLVAR_ARG" 2>&1 || rm -f "$SHELLVAR_ARG" 2>&1`
RV=$?
[ $RV -ne 0 ] && echo "+ERROR:$RV"
[ $RV -ne 0 ] && echo "+ERROR:$SHELLVAR_OUT"
}

SHELLFCN_CMD_REMOVE_DIR() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH || exit
rmdir "$SHELLVAR_ARG_PATH" >>$SHELLVAR_LOG 2>&1 || rm -f "$SHELLVAR_ARG_PATH" >>$SHELLVAR_LOG 2>&1
SHELLVAR_OUT=`rmdir "$SHELLVAR_ARG" 2>&1 || rm -f "$SHELLVAR_ARG" 2>&1`
RV=$?
[ $RV -ne 0 ] && echo "+ERROR:$RV"
[ $RV -ne 0 ] && echo "+ERROR:$SHELLVAR_OUT"
}

SHELLFCN_CMD_CREATE_DIR() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH || exit
$SHELLVAR_READ_FN SHELLVAR_ARG_MODE || exit
mkdir -m "$SHELLVAR_ARG_MODE" "$SHELLVAR_ARG_PATH" >>$SHELLVAR_LOG 2>&1
SHELLVAR_OUT=`mkdir -m "$SHELLVAR_ARG_MODE" "$SHELLVAR_ARG" 2>&1`
RV=$?
[ $RV -ne 0 ] && echo "+ERROR:$RV"
[ $RV -ne 0 ] && echo "+ERROR:$SHELLVAR_OUT"
}

SHELLFCN_CMD_RENAME() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH1 || exit
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH2 || exit
mv "$SHELLVAR_ARG_PATH1" "$SHELLVAR_ARG_PATH2" >>$SHELLVAR_LOG 2>&1
$SHELLVAR_READ_FN SHELLVAR_ARG_DEST || exit
SHELLVAR_OUT=`mv "$SHELLVAR_ARG" "$SHELLVAR_ARG_DEST" 2>&1`
RV=$?
[ $RV -ne 0 ] && echo "+ERROR:$RV"
[ $RV -ne 0 ] && echo "+ERROR:$SHELLVAR_OUT"
}

SHELLFCN_READLINK_BY_LS() {
Expand All @@ -301,38 +304,34 @@ SHELLFCN_READLINK_BY_LS() {
}

SHELLFCN_CMD_READ_SYMLINK() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH_LINK || exit
LNK=`$SHELLVAR_READLINK_FN "$SHELLVAR_ARG_PATH_LINK" 2>>$SHELLVAR_LOG`
SHELLVAR_OUT=`$SHELLVAR_READLINK_FN "$SHELLVAR_ARG" 2>>$SHELLVAR_LOG`
RV=$?
if [ $RV -eq 0 ]; then
echo "+OK:$LNK"
echo "+OK:$SHELLVAR_OUT"
else
echo "+ERROR:$RV"
SHELLVAR_OUT=`$SHELLVAR_READLINK_FN "$SHELLVAR_ARG" 2>&1`
echo "+ERROR:$SHELLVAR_OUT"
fi
}

SHELLFCN_CMD_MAKE_SYMLINK() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH_LINK || exit
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH_FILE || exit
ln -s "$SHELLVAR_ARG_PATH_FILE" "$SHELLVAR_ARG_PATH_LINK" >>$SHELLVAR_LOG 2>&1
$SHELLVAR_READ_FN SHELLVAR_ARG_DEST || exit
SHELLVAR_OUT=`ln -s "$SHELLVAR_ARG_DEST" "$SHELLVAR_ARG" 2>&1`
RV=$?
[ $RV -ne 0 ] && echo "+ERROR:$RV"
[ $RV -ne 0 ] && echo "+ERROR:$SHELLVAR_OUT"
}

SHELLFCN_CMD_SET_MODE() {
$SHELLVAR_READ_FN SHELLVAR_ARG_PATH || exit
$SHELLVAR_READ_FN SHELLVAR_ARG_MODE || exit
chmod "$SHELLVAR_ARG_MODE" "$SHELLVAR_ARG_PATH" >>$SHELLVAR_LOG 2>&1
SHELLVAR_OUT=`chmod "$SHELLVAR_ARG_MODE" "$SHELLVAR_ARG" 2>&1`
RV=$?
[ $RV -ne 0 ] && echo "+ERROR:$RV"
[ $RV -ne 0 ] && echo "+ERROR:$SHELLVAR_OUT"
}

SHELLFCN_CMD_EXECUTE() {
$SHELLVAR_READ_FN SHELLVAR_ARG_CMD || exit
$SHELLVAR_READ_FN SHELLVAR_ARG_WD || exit
$SHELLVAR_READ_FN SHELLVAR_ARG_TOKEN || exit
$SHELLVAR_READ_FN SHELLVAR_ARG_TOKEN SHELLVAR_ARG_WD || exit
if cd "$SHELLVAR_ARG_WD"; then
eval $SHELLVAR_ARG_CMD
eval $SHELLVAR_ARG
RV=$?
echo;echo "$SHELLVAR_ARG_TOKEN:$RV"
else
Expand Down Expand Up @@ -422,34 +421,34 @@ fi
#SHELLVAR_BASE64=
#echo "SHELLVAR_LS_ARGS=$SHELLVAR_LS_ARGS"

FEATS=
SHELLVAR_FEATS=
if [ -n "$SHELLVAR_STAT" ]; then
FEATS="${FEATS}STAT "
SHELLVAR_FEATS="${SHELLVAR_FEATS}STAT "
elif [ -n "$SHELLVAR_FIND" ]; then
FEATS="${FEATS}FIND "
SHELLVAR_FEATS="${SHELLVAR_FEATS}FIND "
else
FEATS="${FEATS}LS "
SHELLVAR_FEATS="${SHELLVAR_FEATS}LS "
fi

if [ -n "$SHELLVAR_DD" ]; then
FEATS="${FEATS}READ_RESUME WRITE_RESUME "
SHELLVAR_FEATS="${SHELLVAR_FEATS}READ_RESUME WRITE_RESUME "
elif [ -n "$SHELLVAR_HEAD" ]; then
FEATS="${FEATS}READ WRITE_RESUME "
[ -n "$SHELLVAR_WRITE_BLOCK" ] && FEATS="${FEATS}WRITE_BLOCK=$SHELLVAR_WRITE_BLOCK "
SHELLVAR_FEATS="${SHELLVAR_FEATS}READ WRITE_RESUME "
[ -n "$SHELLVAR_WRITE_BLOCK" ] && SHELLVAR_FEATS="${SHELLVAR_FEATS}WRITE_BLOCK=$SHELLVAR_WRITE_BLOCK "
elif [ -n "$SHELLVAR_BASE64" ]; then
FEATS="${FEATS}READ WRITE_RESUME WRITE_BASE64 "
SHELLVAR_FEATS="${SHELLVAR_FEATS}READ WRITE_RESUME WRITE_BASE64 "
else
FEATS="${FEATS}READ "
SHELLVAR_FEATS="${SHELLVAR_FEATS}READ "
fi

echo;echo;echo;
SHELLVAR_NOPROMPT=
while true; do
[ ! -n "$SHELLVAR_NOPROMPT" ] && echo && echo '>(((^>'
SHELLVAR_NOPROMPT=
$SHELLVAR_READ_FN CMD || exit
case "$CMD" in
feats ) echo "FEATS ${FEATS} SHELL.FAR2L";;
$SHELLVAR_READ_FN SHELLVAR_CMD SHELLVAR_ARG || exit
case "$SHELLVAR_CMD" in
feats ) echo "FEATS ${SHELLVAR_FEATS} SHELL.FAR2L";;
enum ) SHELLFCN_CMD_ENUM;;
linfo ) SHELLFCN_CMD_INFO_SINGLE '0' "$SHELLVAR_STAT_FMT_INFO" "$SHELLVAR_FIND_FMT_INFO" '';;
info ) SHELLFCN_CMD_INFO_SINGLE '1' "$SHELLVAR_STAT_FMT_INFO" "$SHELLVAR_FIND_FMT_INFO" '';;
Expand Down Expand Up @@ -478,6 +477,6 @@ while true; do
# - lets mimic shell's responce so negotiation sequence will continue.
# sleep 3 ensures 'fishy' prompt will be printed at the right time moment
echo ) echo; echo 'far2l is ready for fishing'; sleep 3;;
* ) echo "Bad CMD='$CMD'" >>$SHELLVAR_LOG; echo "??? '$CMD'";;
* ) echo "Bad CMD='$SHELLVAR_CMD'" >>$SHELLVAR_LOG; echo "??? '$SHELLVAR_CMD'";;
esac
done
Loading

0 comments on commit 67fa8c2

Please sign in to comment.