Skip to content

Commit

Permalink
applets_sh/*: Add a few more examples of "shell applets"
Browse files Browse the repository at this point in the history
Signed-off-by: Pere Orga <[email protected]>
Signed-off-by: Denys Vlasenko <[email protected]>
  • Loading branch information
pereorga authored and Denys Vlasenko committed Feb 9, 2012
1 parent 594db1e commit d022250
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applets_sh/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This directory contains examples of applets implemented as shell scripts.

So far these scripts are not hooked to the build system and are not
installed by "make install". If you want to use them,
you need to install them by hand.
5 changes: 5 additions & 0 deletions applets_sh/dos2unix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# TODO: use getopt to avoid parsing options as filenames,
# and to support -- and --help
[ $# -ne 0 ] && DASH_I=-i
sed $DASH_I -e 's/\r$//' "$@"
7 changes: 7 additions & 0 deletions applets_sh/tac
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# TODO: use getopt to avoid parsing options as filenames,
# and to support -- and --help
for i in "$@"
do
sed -e '1!G;h;$!d' "$i"
done
5 changes: 5 additions & 0 deletions applets_sh/unix2dos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# TODO: use getopt to avoid parsing options as filenames,
# and to support -- and --help
[ $# -ne 0 ] && DASH_I=-i
sed $DASH_I -e 's/$/\r/' "$@"

0 comments on commit d022250

Please sign in to comment.