summaryrefslogtreecommitdiffstats
path: root/src/vfs/fish/helpers
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/vfs/fish/helpers/Makefile.am10
-rw-r--r--src/vfs/fish/helpers/README.fish217
-rw-r--r--src/vfs/fish/helpers/append16
-rw-r--r--src/vfs/fish/helpers/chmod6
-rw-r--r--src/vfs/fish/helpers/chown6
-rw-r--r--src/vfs/fish/helpers/fexists3
-rw-r--r--src/vfs/fish/helpers/mkdir6
-rw-r--r--src/vfs/fish/helpers/mv6
-rw-r--r--src/vfs/fish/helpers/rmdir6
-rw-r--r--src/vfs/fish/helpers/send17
-rw-r--r--src/vfs/fish/helpers/unlink6
-rw-r--r--src/vfs/fish/helpers/utime13
-rw-r--r--src/vfs/shell/helpers/Makefile.in (renamed from src/vfs/fish/helpers/Makefile.in)60
-rw-r--r--src/vfs/shell/helpers/get (renamed from src/vfs/fish/helpers/get)17
-rw-r--r--src/vfs/shell/helpers/hardlink (renamed from src/vfs/fish/helpers/hardlink)5
-rw-r--r--src/vfs/shell/helpers/info (renamed from src/vfs/fish/helpers/info)14
-rw-r--r--src/vfs/shell/helpers/ln (renamed from src/vfs/fish/helpers/ln)5
-rw-r--r--src/vfs/shell/helpers/ls (renamed from src/vfs/fish/helpers/ls)58
18 files changed, 77 insertions, 394 deletions
diff --git a/src/vfs/fish/helpers/Makefile.am b/src/vfs/fish/helpers/Makefile.am
deleted file mode 100644
index e3ba15d..0000000
--- a/src/vfs/fish/helpers/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-fishdir = $(libexecdir)/@PACKAGE@/fish
-
-# Files to install and distribute other than fish scripts
-FISH_MISC = README.fish
-
-# Install and distribute FISH helper scripts w/o shebang & executable bit as data
-fish_DATA = $(FISH_MISC) ls mkdir fexists unlink chown chmod rmdir ln mv hardlink get send append info utime
-fishconfdir = $(sysconfdir)/@PACKAGE@
-
-EXTRA_DIST = $(fish_DATA)
diff --git a/src/vfs/fish/helpers/README.fish b/src/vfs/fish/helpers/README.fish
deleted file mode 100644
index ac319c8..0000000
--- a/src/vfs/fish/helpers/README.fish
+++ /dev/null
@@ -1,217 +0,0 @@
-
- FIles transferred over SHell protocol (V 0.0.3)
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-This protocol was designed for transferring files over a remote shell
-connection (rsh and compatibles). It can be as well used for transfers over
-rsh, and there may be other uses.
-
-Client sends requests of following form:
-
-#FISH_COMMAND
-equivalent shell commands,
-which may be multiline
-
-Only fish commands are defined here, shell equivalents are for your
-information only and will probably vary from implementation to
-implementation. Fish commands always have priority: server is
-expected to execute fish command if it understands it. If it does not,
-however, it can try the luck and execute shell command.
-
-Since version 4.7.3, the scripts that FISH sends to host machines after
-a command is transmitted are no longer hardwired in the Midnight
-Commander source code.
-
-First, mc looks for system-wide set of scripts, then it checks whether
-current user has host-specific overrides in his per-user mc
-configuration directory. User-defined overrides take priority over
-sytem-wide scripts if they exist. The order in which the directories are
-traversed is as follows:
-
- /usr/libexec/mc/fish
- ~/.local/share/mc/fish/<hostname>/
-
-Server's reply is multiline, but always ends with
-
-### 000<optional text>
-
-line. ### is prefix to mark this line, 000 is return code. Return
-codes are superset to those used in ftp.
-
-There are few new exit codes defined:
-
-000 don't know; if there were no previous lines, this marks COMPLETE
-success, if they were, it marks failure.
-
-001 don't know; if there were no previous lines, this marks
-PRELIMinary success, if they were, it marks failure
-
- Connecting
- ~~~~~~~~~~
-Client uses "echo FISH:;/bin/sh" as command executed on remote
-machine. This should make it possible for server to distinguish FISH
-connections from normal rsh/ssh.
-
- Commands
- ~~~~~~~~
-#FISH
-echo; start_fish_server; echo '### 200'
-
-This command is sent at the beginning. It marks that client wishes to
-talk via FISH protocol. #VER command must follow. If server
-understands FISH protocol, it has option to put FISH server somewhere
-on system path and name it start_fish_server.
-
-#VER 0.0.2 <feature1> <feature2> <...>
-echo '### 000'
-
-This command is the second one. It sends client version and extensions
-to the server. Server should reply with protocol version to be used,
-and list of extensions accepted.
-
-VER 0.0.0 <feature2>
-### 200
-
-#PWD
-pwd; echo '### 200'
-
-Server should reply with current directory (in form /abc/def/ghi)
-followed by line indicating success.
-
-#LIST /directory
-ls -lLa $1 | grep '^[^cbt]' | ( while read p x u g s m d y n; do echo "P$p $u.$g
-S$s
-d$m $d $y
-:$n
-"; done )
-ls -lLa $1 | grep '^[cb]' | ( while read p x u g a i m d y n; do echo "P$p $u.$g
-E$a$i
-dD$m $d $y
-:$n
-"; done )
-echo '### 200'
-
-This allows client to list directory or get status information about
-single file. Output is in following form (any line except :<filename>
-may be omitted):
-
-P<unix permissions> <owner>.<group>
-S<size>
-d<3-letters month name> <day> <year or HH:MM>
-D<year> <month> <day> <hour> <minute> <second>[.1234]
-E<major-of-device>,<minor>
-:<filename>
-L<filename symlink points to>
-<blank line to separate items>
-
-Unix permissions are of form X--------- where X is type of
-file. Currently, '-' means regular file, 'd' means directory, 'c', 'b'
-means character and block device, 'l' means symbolic link, 'p' means
-FIFO and 's' means socket.
-
-'d' has three fields: month (one of strings Jan Feb Mar Apr May Jun
-Jul Aug Sep Oct Nov Dec), day of month, and third is either single
-number indicating year, or HH:MM field (assume current year in such
-case). As you've probably noticed, this is pretty broken; it is for
-compatibility with ls listing.
-
-#RETR /some/name
-ls -l /some/name | ( read a b c d x e; echo $x ); echo '### 100'; cat /some/name; echo '### 200'
-
-Server sends line with filesize on it, followed by line with ### 100
-indicating partial success, then it sends binary data (exactly
-filesize bytes) and follows them with (with no preceding newline) ###
-200.
-
-Note that there's no way to abort running RETR command - except
-closing the connection.
-
-#STOR <size> /file/name
-> /file/name; echo '### 001'; ( dd bs=4096 count=<size/4096>; dd bs=<size%4096> count=1 ) 2>/dev/null | ( cat > %s; cat > /dev/null ); echo '### 200'
-
-This command is for storing /file/name, which is exactly size bytes
-big. You probably think I went crazy. Well, I did not: that strange
-cat > /dev/null has purpose to discard any extra data which was not
-written to disk (due to for example out of space condition).
-
-[Why? Imagine uploading file with "rm -rf /" line in it.]
-
-#CWD /somewhere
-cd /somewhere; echo '### 000'
-
-It is specified here, but I'm not sure how wise idea is to use this
-one: it breaks stateless-ness of the protocol.
-
-Following commands should be rather self-explanatory:
-
-#CHMOD 1234 file
-chmod 1234 file; echo '### 000'
-
-#DELE /some/path
-rm -f /some/path; echo '### 000'
-
-#MKD /some/path
-mkdir /some/path; echo '### 000'
-
-#RMD /some/path
-rmdir /some/path; echo '### 000'
-
-#RENAME /path/a /path/b
-mv /path/a /path/b; echo '### 000'
-
-#LINK /path/a /path/b
-ln /path/a /path/b; echo '### 000'
-
-#SYMLINK /path/a /path/b
-ln -s /path/a /path/b; echo '### 000'
-
-#CHOWN user /file/name
-chown user /file/name; echo '### 000'
-
-#CHGRP group /file/name
-chgrp group /file/name; echo '### 000'
-
-#INFO
-...collect info about host into $result ...
-echo $result
-echo '### 200'
-
-#READ <offset> <size> /path/and/filename
-cat /path/and/filename | ( dd bs=4096 count=<offset/4096> > /dev/null;
-dd bs=<offset%4096> count=1 > /dev/null;
-dd bs=4096 count=<offset/4096>;
-dd bs=<offset%4096> count=1; )
-
-Returns ### 200 on successful exit, ### 291 on successful exit when
-reading ended at eof, ### 292 on successful exit when reading did not
-end at eof.
-
-#WRITE <offset> <size> /path/and/filename
-
-Hmm, shall we define these ones if we know our client is not going to
-use them?
-
-you can use follow parameters:
-FISH_FILESIZE
-FISH_FILENAME
-FISH_FILEMODE
-FISH_FILEOWNER
-FISH_FILEGROUPE
-FISH_FILEFROM
-FISH_FILETO
-
-NB:
-'FISH_FILESIZE' used if we operate with single file name in 'unlink', 'rmdir', 'chmod', etc...
-'FISH_FILEFROM','FISH_FILETO' used if we operate with two files in 'ln', 'hardlink', 'mv' etc...
-'FISH_FILEOWNER', 'FISH_FILEGROUPE' is a new user/group in chown
-
-also flags:
-FISH_HAVE_HEAD
-FISH_HAVE_SED
-FISH_HAVE_AWK
-FISH_HAVE_PERL
-FISH_HAVE_LSQ
-FISH_HAVE_DATE_MDYT
-
-That's all, folks!
- pavel@ucw.cz
diff --git a/src/vfs/fish/helpers/append b/src/vfs/fish/helpers/append
deleted file mode 100644
index 81ded44..0000000
--- a/src/vfs/fish/helpers/append
+++ /dev/null
@@ -1,16 +0,0 @@
-#APPE $FISH_FILESIZE $FISH_FILENAME
-FILENAME="/${FISH_FILENAME}"
-echo "### 001"
-{
- bss=4096
- bsl=4095
- if [ $FISH_FILESIZE -lt $bss ]; then
- bss=1;
- bsl=0;
- fi
- while [ $FISH_FILESIZE -gt 0 ]; do
- cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss`
- n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c`
- FISH_FILESIZE=`expr $FISH_FILESIZE - $n`
- done
-}; echo "### 200"
diff --git a/src/vfs/fish/helpers/chmod b/src/vfs/fish/helpers/chmod
deleted file mode 100644
index a5a88b4..0000000
--- a/src/vfs/fish/helpers/chmod
+++ /dev/null
@@ -1,6 +0,0 @@
-#CHMOD $FISH_FILEMODE $FISH_FILENAME
-if chmod ${FISH_FILEMODE} "/${FISH_FILENAME}" 2>/dev/null; then
- echo "### 000"
-else
- echo "### 500"
-fi
diff --git a/src/vfs/fish/helpers/chown b/src/vfs/fish/helpers/chown
deleted file mode 100644
index 469fdc1..0000000
--- a/src/vfs/fish/helpers/chown
+++ /dev/null
@@ -1,6 +0,0 @@
-#CHOWN $FISH_FILEOWNER:$FISH_FILEGROUP $FISH_FILENAME
-if chown ${FISH_FILEOWNER}:${FISH_FILEGROUP} "/${FISH_FILENAME}" ; then
- echo "### 000"
-else
- echo "### 500"
-fi
diff --git a/src/vfs/fish/helpers/fexists b/src/vfs/fish/helpers/fexists
deleted file mode 100644
index cf03b15..0000000
--- a/src/vfs/fish/helpers/fexists
+++ /dev/null
@@ -1,3 +0,0 @@
-#ISEXISTS $FISH_FILENAME
-ls -l "/${FISH_FILENAME}" >/dev/null 2>/dev/null
-echo '### '$?
diff --git a/src/vfs/fish/helpers/mkdir b/src/vfs/fish/helpers/mkdir
deleted file mode 100644
index b32e995..0000000
--- a/src/vfs/fish/helpers/mkdir
+++ /dev/null
@@ -1,6 +0,0 @@
-#MKD $FISH_FILENAME
-if mkdir "/$FISH_FILENAME" 2>/dev/null; then
- echo "### 000"
-else
- echo "### 500"
-fi
diff --git a/src/vfs/fish/helpers/mv b/src/vfs/fish/helpers/mv
deleted file mode 100644
index c8cf70c..0000000
--- a/src/vfs/fish/helpers/mv
+++ /dev/null
@@ -1,6 +0,0 @@
-#RENAME $FISH_FILEFROM $FISH_FILETO
-if mv "/${FISH_FILEFROM}" "/${FISH_FILETO}" 2>/dev/null; then
- echo "### 000"
-else
- echo "### 500"
-fi
diff --git a/src/vfs/fish/helpers/rmdir b/src/vfs/fish/helpers/rmdir
deleted file mode 100644
index 0f99bf6..0000000
--- a/src/vfs/fish/helpers/rmdir
+++ /dev/null
@@ -1,6 +0,0 @@
-#RMD $FISH_FILENAME
-if rmdir "/${FISH_FILENAME}" 2>/dev/null; then
- echo "### 000"
-else
- echo "### 500"
-fi
diff --git a/src/vfs/fish/helpers/send b/src/vfs/fish/helpers/send
deleted file mode 100644
index 80dd22b..0000000
--- a/src/vfs/fish/helpers/send
+++ /dev/null
@@ -1,17 +0,0 @@
-#STOR $FISH_FILESIZE $FISH_FILENAME
-FILENAME="/${FISH_FILENAME}"
-echo "### 001"
-{
- > "${FILENAME}"
- bss=4096
- bsl=4095
- if [ $FISH_FILESIZE -lt $bss ]; then
- bss=1;
- bsl=0;
- fi
- while [ $FISH_FILESIZE -gt 0 ]; do
- cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss`
- n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c`
- FISH_FILESIZE=`expr $FISH_FILESIZE - $n`
- done
-}; echo "### 200"
diff --git a/src/vfs/fish/helpers/unlink b/src/vfs/fish/helpers/unlink
deleted file mode 100644
index 79b9ad0..0000000
--- a/src/vfs/fish/helpers/unlink
+++ /dev/null
@@ -1,6 +0,0 @@
-#DELE $FISH_FILENAME
-if rm -f "/${FISH_FILENAME}" 2>/dev/null; then
- echo "### 000"
-else
- echo "### 500"
-fi
diff --git a/src/vfs/fish/helpers/utime b/src/vfs/fish/helpers/utime
deleted file mode 100644
index 94395b4..0000000
--- a/src/vfs/fish/helpers/utime
+++ /dev/null
@@ -1,13 +0,0 @@
-#UTIME "$FISH_TOUCHATIME_W_NSEC" "$FISH_TOUCHMTIME_W_NSEC" "$FISH_FILENAME"
-if TZ=UTC touch -h -m -d "$FISH_TOUCHMTIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null && \
- TZ=UTC touch -h -a -d "$FISH_TOUCHATIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null; then
- echo "### 000"
-elif TZ=UTC touch -h -m -t $FISH_TOUCHMTIME "/${FISH_FILENAME}" 2>/dev/null && \
- TZ=UTC touch -h -a -t $FISH_TOUCHATIME "/${FISH_FILENAME}" 2>/dev/null; then
- echo "### 000"
-elif [ -n "$FISH_HAVE_PERL" ] &&
- perl -e 'utime '$FISH_FILEATIME','$FISH_FILEMTIME',@ARGV;' "/${FISH_FILENAME}" 2>/dev/null; then
- echo "### 000"
-else
- echo "### 500"
-fi
diff --git a/src/vfs/fish/helpers/Makefile.in b/src/vfs/shell/helpers/Makefile.in
index c17efbb..cef7b97 100644
--- a/src/vfs/fish/helpers/Makefile.in
+++ b/src/vfs/shell/helpers/Makefile.in
@@ -88,7 +88,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-subdir = src/vfs/fish/helpers
+subdir = src/vfs/shell/helpers
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
@@ -134,7 +134,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \
- $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \
+ $(top_srcdir)/m4.include/vfs/mc-vfs-shell.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \
@@ -196,8 +196,8 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(fishdir)"
-DATA = $(fish_DATA)
+am__installdirs = "$(DESTDIR)$(shelldir)"
+DATA = $(shell_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -410,15 +410,15 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-fishdir = $(libexecdir)/@PACKAGE@/fish
+shelldir = $(libexecdir)/@PACKAGE@/shell
-# Files to install and distribute other than fish scripts
-FISH_MISC = README.fish
+# Files to install and distribute other than shell scripts
+SHELL_MISC = README.shell
-# Install and distribute FISH helper scripts w/o shebang & executable bit as data
-fish_DATA = $(FISH_MISC) ls mkdir fexists unlink chown chmod rmdir ln mv hardlink get send append info utime
-fishconfdir = $(sysconfdir)/@PACKAGE@
-EXTRA_DIST = $(fish_DATA)
+# Install and distribute SHELL helper scripts w/o shebang & executable bit as data
+shell_DATA = $(SHELL_MISC) ls mkdir fexists unlink chown chmod rmdir ln mv hardlink get send append info utime
+shellconfdir = $(sysconfdir)/@PACKAGE@
+EXTRA_DIST = $(shell_DATA)
all: all-am
.SUFFIXES:
@@ -431,9 +431,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/vfs/fish/helpers/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/vfs/shell/helpers/Makefile'; \
$(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/vfs/fish/helpers/Makefile
+ $(AUTOMAKE) --gnu src/vfs/shell/helpers/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -457,27 +457,27 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-install-fishDATA: $(fish_DATA)
+install-shellDATA: $(shell_DATA)
@$(NORMAL_INSTALL)
- @list='$(fish_DATA)'; test -n "$(fishdir)" || list=; \
+ @list='$(shell_DATA)'; test -n "$(shelldir)" || list=; \
if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(fishdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(fishdir)" || exit 1; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(shelldir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(shelldir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(fishdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(fishdir)" || exit $$?; \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(shelldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(shelldir)" || exit $$?; \
done
-uninstall-fishDATA:
+uninstall-shellDATA:
@$(NORMAL_UNINSTALL)
- @list='$(fish_DATA)'; test -n "$(fishdir)" || list=; \
+ @list='$(shell_DATA)'; test -n "$(shelldir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(fishdir)'; $(am__uninstall_files_from_dir)
+ dir='$(DESTDIR)$(shelldir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
@@ -521,7 +521,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(fishdir)"; do \
+ for dir in "$(DESTDIR)$(shelldir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -574,7 +574,7 @@ info: info-am
info-am:
-install-data-am: install-fishDATA
+install-data-am: install-shellDATA
install-dvi: install-dvi-am
@@ -618,7 +618,7 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-fishDATA
+uninstall-am: uninstall-shellDATA
.MAKE: install-am install-strip
@@ -626,13 +626,13 @@ uninstall-am: uninstall-fishDATA
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-fishDATA \
- install-html install-html-am install-info install-info-am \
- install-man install-pdf install-pdf-am install-ps \
- install-ps-am install-strip installcheck installcheck-am \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-shellDATA install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags-am uninstall uninstall-am uninstall-fishDATA
+ ps ps-am tags-am uninstall uninstall-am uninstall-shellDATA
.PRECIOUS: Makefile
diff --git a/src/vfs/fish/helpers/get b/src/vfs/shell/helpers/get
index 762267a..b633a45 100644
--- a/src/vfs/fish/helpers/get
+++ b/src/vfs/shell/helpers/get
@@ -1,7 +1,6 @@
-#RETR $FISH_FILENAME $FISH_START_OFFSET
LC_TIME=C
export LC_TIME
-fish_get_perl ()
+shell_get_perl ()
{
FILENAME=$1
OFFSET=$2
@@ -35,7 +34,7 @@ exit 0
' "${FILENAME}" $OFFSET
}
-fish_get_tail ()
+shell_get_tail ()
{
FILENAME=$1
OFFSET=$2
@@ -67,7 +66,7 @@ else
fi
}
-fish_get_dd ()
+shell_get_dd ()
{
FILENAME=$1
OFFSET=$2
@@ -96,10 +95,10 @@ else
fi
}
-if [ -n "${FISH_HAVE_PERL}" ]; then
- fish_get_perl "/${FISH_FILENAME}" ${FISH_START_OFFSET}
-elif [ -n "${FISH_HAVE_TAIL}" ]; then
- fish_get_tail "/${FISH_FILENAME}" ${FISH_START_OFFSET}
+if [ -n "${SHELL_HAVE_PERL}" ]; then
+ shell_get_perl "/${SHELL_FILENAME}" ${SHELL_START_OFFSET}
+elif [ -n "${SHELL_HAVE_TAIL}" ]; then
+ shell_get_tail "/${SHELL_FILENAME}" ${SHELL_START_OFFSET}
else
- fish_get_dd "/${FISH_FILENAME}" ${FISH_START_OFFSET}
+ shell_get_dd "/${SHELL_FILENAME}" ${SHELL_START_OFFSET}
fi
diff --git a/src/vfs/fish/helpers/hardlink b/src/vfs/shell/helpers/hardlink
index 4f36b3f..f92b332 100644
--- a/src/vfs/fish/helpers/hardlink
+++ b/src/vfs/shell/helpers/hardlink
@@ -1,6 +1,5 @@
-#LINK $FISH_FILEFROM $FISH_FILETO
-FILEFROM="/${FISH_FILEFROM}"
-FILETO="/${FISH_FILETO}"
+FILEFROM="/${SHELL_FILEFROM}"
+FILETO="/${SHELL_FILETO}"
if ln "${FILEFROM}" "${FILETO}" 2>/dev/null; then
echo "### 000"
else
diff --git a/src/vfs/fish/helpers/info b/src/vfs/shell/helpers/info
index b85b0a7..053423a 100644
--- a/src/vfs/fish/helpers/info
+++ b/src/vfs/shell/helpers/info
@@ -1,12 +1,12 @@
LC_TIME=C
export LC_TIME
-#FISH_HAVE_HEAD 1
-#FISH_HAVE_SED 2
-#FISH_HAVE_AWK 4
-#FISH_HAVE_PERL 8
-#FISH_HAVE_LSQ 16
-#FISH_HAVE_DATE_MDYT 32
-#FISH_HAVE_TAIL 64
+#SHELL_HAVE_HEAD 1
+#SHELL_HAVE_SED 2
+#SHELL_HAVE_AWK 4
+#SHELL_HAVE_PERL 8
+#SHELL_HAVE_LSQ 16
+#SHELL_HAVE_DATE_MDYT 32
+#SHELL_HAVE_TAIL 64
res=0
if `echo yes| head -c 1 > /dev/null 2>&1` ; then
res=`expr $res + 1`
diff --git a/src/vfs/fish/helpers/ln b/src/vfs/shell/helpers/ln
index a8445d8..15a20cd 100644
--- a/src/vfs/fish/helpers/ln
+++ b/src/vfs/shell/helpers/ln
@@ -1,6 +1,5 @@
-#SYMLINK $FISH_FILEFROM $FISH_FILETO
-FILEFROM="${FISH_FILEFROM}"
-FILETO="/${FISH_FILETO}"
+FILEFROM="${SHELL_FILEFROM}"
+FILETO="/${SHELL_FILETO}"
if ln -s "${FILEFROM}" "${FILETO}" 2>/dev/null; then
echo "### 000"
else
diff --git a/src/vfs/fish/helpers/ls b/src/vfs/shell/helpers/ls
index 7165b51..c7701d6 100644
--- a/src/vfs/fish/helpers/ls
+++ b/src/vfs/shell/helpers/ls
@@ -1,11 +1,10 @@
-#LIST /${FISH_DIR}
LC_TIME=C
export LC_TIME
perl_res="1"
-fish_list_lsq ()
+shell_list_lsq ()
{
-FISH_DIR="$1"
-ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | (
+SHELL_DIR="$1"
+ls -Qlan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | (
while read p l u g s m d y n; do
echo "P$p $u.$g"
echo "S$s"
@@ -15,7 +14,7 @@ while read p l u g s m d y n; do
done
)
-ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | (
+ls -Qlan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | (
while read p l u g a i m d y n; do
echo "P$p $u.$g"
echo "E$a$i"
@@ -27,13 +26,13 @@ done
echo '### 200'
}
-fish_list_sed ()
+shell_list_sed ()
{
-FISH_DIR="$1"
-ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | (
+SHELL_DIR="$1"
+ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | (
while read p l u g s rec; do
if [ -n "$g" ]; then
- if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
+ if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'`
filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'`
else
@@ -43,7 +42,7 @@ while read p l u g s rec; do
pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\"
echo "P$p $u.$g"
echo "S$s"
- if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
+ if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
echo "d$filedate"
else
echo "D$filedate"
@@ -53,10 +52,10 @@ while read p l u g s rec; do
fi
done
)
-ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | (
+ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | (
while read p l u g a i rec; do
if [ -n "$g" ]; then
- if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
+ if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'`
filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'`
else
@@ -66,7 +65,7 @@ while read p l u g a i rec; do
pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\"
echo "P$p $u.$g"
echo "E$a$i"
- if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
+ if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
echo "d$filedate"
else
echo "D$filedate"
@@ -79,10 +78,10 @@ done
echo '### 200'
}
-fish_list_poor_ls ()
+shell_list_poor_ls ()
{
-FISH_DIR="$1"
-ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | (
+SHELL_DIR="$1"
+ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | (
while read p l u g s m d y n n2 n3; do
if [ -n "$g" ]; then
if [ "$m" = "0" ]; then
@@ -98,7 +97,7 @@ while read p l u g s m d y n n2 n3; do
fi
done
)
-ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | (
+ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | (
while read p l u g a i m d y n n2 n3; do
if [ -n "$g" ]; then
if [ "$a" = "0" ]; then
@@ -117,15 +116,14 @@ done
echo '### 200'
}
-fish_list_perl ()
+shell_list_perl ()
{
-FISH_DIR=$1
+SHELL_DIR=$1
perl -e '
use strict;
use POSIX;
-use Fcntl;
-use POSIX ":fcntl_h"; #S_ISLNK was here until 5.6
-import Fcntl ":mode" unless defined &S_ISLNK; #and is now here
+use Fcntl ":mode"; # S_ISLNK, S_IFMT, S_IMODE are here
+use POSIX ":fcntl_h"; # S_ISLNK might be here as well
my $dirname = $ARGV[0];
if (opendir (DIR, $dirname)) {
while((my $filename = readdir (DIR))){
@@ -152,19 +150,19 @@ while((my $filename = readdir (DIR))){
printf("### 500\n");
}
exit 0
-' "/${FISH_DIR}"
+' "/${SHELL_DIR}"
perl_res=$?
}
-if [ -n "${FISH_HAVE_PERL}" ]; then
- fish_list_perl "/${FISH_FILENAME}"
+if [ -n "${SHELL_HAVE_PERL}" ]; then
+ shell_list_perl "/${SHELL_FILENAME}"
fi
if [ "${perl_res}" != "0" ]; then
- if [ -n "${FISH_HAVE_LSQ}" ]; then
- fish_list_lsq "/${FISH_FILENAME}"
- elif [ -n "${FISH_HAVE_SED}" ]; then
- fish_list_sed "/${FISH_FILENAME}"
+ if [ -n "${SHELL_HAVE_LSQ}" ]; then
+ shell_list_lsq "/${SHELL_FILENAME}"
+ elif [ -n "${SHELL_HAVE_SED}" ]; then
+ shell_list_sed "/${SHELL_FILENAME}"
else
- fish_list_poor_ls "/${FISH_FILENAME}"
+ shell_list_poor_ls "/${SHELL_FILENAME}"
fi
fi