aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPere Orga <gotrunks@gmail.com>2012-02-09 18:23:33 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-02-09 18:23:33 +0100
commitd0222503ff9ff264efa74f6de651b308d20a05b8 (patch)
tree7eb01024fd36dfebc5f303a3cc408766925b1604
parent594db1e62a060a0a5646f6840112189fd0ce3b81 (diff)
downloadbusybox-w32-d0222503ff9ff264efa74f6de651b308d20a05b8.tar.gz
busybox-w32-d0222503ff9ff264efa74f6de651b308d20a05b8.tar.bz2
busybox-w32-d0222503ff9ff264efa74f6de651b308d20a05b8.zip
applets_sh/*: Add a few more examples of "shell applets"
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--applets_sh/README5
-rwxr-xr-xapplets_sh/dos2unix5
-rwxr-xr-xapplets_sh/tac7
-rwxr-xr-xapplets_sh/unix2dos5
4 files changed, 22 insertions, 0 deletions
diff --git a/applets_sh/README b/applets_sh/README
new file mode 100644
index 000000000..9dcd38ae3
--- /dev/null
+++ b/applets_sh/README
@@ -0,0 +1,5 @@
1This directory contains examples of applets implemented as shell scripts.
2
3So far these scripts are not hooked to the build system and are not
4installed by "make install". If you want to use them,
5you need to install them by hand.
diff --git a/applets_sh/dos2unix b/applets_sh/dos2unix
new file mode 100755
index 000000000..0fd5206f6
--- /dev/null
+++ b/applets_sh/dos2unix
@@ -0,0 +1,5 @@
1#!/bin/sh
2# TODO: use getopt to avoid parsing options as filenames,
3# and to support -- and --help
4[ $# -ne 0 ] && DASH_I=-i
5sed $DASH_I -e 's/\r$//' "$@"
diff --git a/applets_sh/tac b/applets_sh/tac
new file mode 100755
index 000000000..c5a8e39c1
--- /dev/null
+++ b/applets_sh/tac
@@ -0,0 +1,7 @@
1#!/bin/sh
2# TODO: use getopt to avoid parsing options as filenames,
3# and to support -- and --help
4for i in "$@"
5do
6sed -e '1!G;h;$!d' "$i"
7done
diff --git a/applets_sh/unix2dos b/applets_sh/unix2dos
new file mode 100755
index 000000000..70e042906
--- /dev/null
+++ b/applets_sh/unix2dos
@@ -0,0 +1,5 @@
1#!/bin/sh
2# TODO: use getopt to avoid parsing options as filenames,
3# and to support -- and --help
4[ $# -ne 0 ] && DASH_I=-i
5sed $DASH_I -e 's/$/\r/' "$@"