Fix double quote handling.

This commit is contained in:
Matt Kraai
2001-04-10 00:00:05 +00:00
parent 2f2da90fd4
commit 4e853560f5
2 changed files with 69 additions and 95 deletions

View File

@@ -27,8 +27,8 @@ sub beautify {
my @line = split("\n", $text); my @line = split("\n", $text);
$text = join('', $text = join('',
map { map {
s/^\s*//; s/^\s*"//;
s/"//g; s/"\s*$//;
s/%/%%/g; s/%/%%/g;
s/\$/\\\$/g; s/\$/\\\$/g;
eval qq[ sprintf(qq{$_}) ] eval qq[ sprintf(qq{$_}) ]
@@ -275,4 +275,4 @@ John BEPPU <beppu@lineo.com>
=cut =cut
# $Id: autodocifier.pl,v 1.19 2001/04/05 20:03:33 beppu Exp $ # $Id: autodocifier.pl,v 1.20 2001/04/10 00:00:05 kraai Exp $

View File

@@ -275,9 +275,9 @@ Options:
Example: Example:
$ echo Hello world | cut -f 1 -d ' ' $ echo "Hello world" | cut -f 1 -d ' '
Hello Hello
$ echo Hello world | cut -f 2 -d ' ' $ echo "Hello world" | cut -f 2 -d ' '
world world
------------------------------- -------------------------------
@@ -536,17 +536,17 @@ Options:
Example: Example:
$ echo Erik is cool $ echo "Erik is cool"
Erik is cool Erik is cool
$ echo -e Erik $ echo -e "Erik
is is
cool cool"
Erik Erik
is is
cool cool
$ echo Erik $ echo "Erik
is is
cool cool"
Erik Erik
is is
cool cool
@@ -630,7 +630,7 @@ Show and modify frame buffer settings
Example: Example:
$ fbset $ fbset
mode 1024x768-76 mode "1024x768-76"
# D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
geometry 1024 768 1024 768 16 geometry 1024 768 1024 768 16
timings 12714 128 32 16 4 128 4 timings 12714 128 32 16 4 128 4
@@ -687,7 +687,6 @@ Example:
Swap: 128516 8404 120112 Swap: 128516 8404 120112
Total: 386144 257128 129016 Total: 386144 257128 129016
------------------------------- -------------------------------
=item B<freeramdisk> =item B<freeramdisk>
@@ -715,7 +714,7 @@ Options:
-a Perform automatic repairs -a Perform automatic repairs
-v verbose -v verbose
-s Outputs super-block information -s Outputs super-block information
-m Activates MINIX-like mode not cleared warnings -m Activates MINIX-like "mode not cleared" warnings
-f Force file system check. -f Force file system check.
------------------------------- -------------------------------
@@ -741,20 +740,20 @@ Example:
$ cat getopt.test $ cat getopt.test
#!/bin/sh #!/bin/sh
GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \ GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
-n 'example.busybox' -- $@` -n 'example.busybox' -- "$@"`
if [ $? != 0 ] ; then exit 1 ; fi if [ $? != 0 ] ; then exit 1 ; fi
eval set -- $GETOPT eval set -- "$GETOPT"
while true ; do while true ; do
case $1 in case $1 in
-a|--a-long) echo Option a ; shift ;; -a|--a-long) echo "Option a" ; shift ;;
-b|--b-long) echo Option b, argument `$2' ; shift 2 ;; -b|--b-long) echo "Option b, argument `$2'" ; shift 2 ;;
-c|--c-long) -c|--c-long)
case $2 in case "$2" in
\) echo Option c, no argument; shift 2 ;; "") echo "Option c, no argument"; shift 2 ;;
*) echo Option c, argument `$2' ; shift 2 ;; *) echo "Option c, argument `$2'" ; shift 2 ;;
esac ;; esac ;;
--) shift ; break ;; --) shift ; break ;;
*) echo Internal error! ; exit 1 ;; *) echo "Internal error!" ; exit 1 ;;
esac esac
done done
@@ -960,7 +959,7 @@ If you choose to use an /etc/inittab file, the inittab entry format is as follow
WARNING: This field has a non-traditional meaning for BusyBox init! WARNING: This field has a non-traditional meaning for BusyBox init!
The id field is used by BusyBox init to specify the controlling tty for The id field is used by BusyBox init to specify the controlling tty for
the specified process to run on. The contents of this field are the specified process to run on. The contents of this field are
appended to /dev/ and used as-is. There is no need for this field to appended to "/dev/" and used as-is. There is no need for this field to
be unique, although if it isn't you may have strange results. If this be unique, although if it isn't you may have strange results. If this
field is left blank, the controlling tty is set to the console. Also field is left blank, the controlling tty is set to the console. Also
note that if BusyBox detects that a serial console is in use, then only note that if BusyBox detects that a serial console is in use, then only
@@ -1003,7 +1002,7 @@ If you choose to use an /etc/inittab file, the inittab entry format is as follow
it. Unlike sysvinit, BusyBox init does not stop processes from it. Unlike sysvinit, BusyBox init does not stop processes from
respawning out of control. The 'askfirst' actions acts just like respawning out of control. The 'askfirst' actions acts just like
respawn, except that before running the specified process it respawn, except that before running the specified process it
displays the line Please press Enter to activate this console. displays the line "Please press Enter to activate this console."
and then waits for the user to press enter before starting the and then waits for the user to press enter before starting the
specified process. specified process.
@@ -1023,9 +1022,9 @@ Example /etc/inittab file:
# /bin/sh invocations on selected ttys # /bin/sh invocations on selected ttys
# #
# Start an askfirst shell on the console (whatever that may be) # Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh ::askfirst:-/bin/sh
# Start an askfirst shell on /dev/tty2-4 # Start an "askfirst" shell on /dev/tty2-4
tty2::askfirst:-/bin/sh tty2::askfirst:-/bin/sh
tty3::askfirst:-/bin/sh tty3::askfirst:-/bin/sh
tty4::askfirst:-/bin/sh tty4::askfirst:-/bin/sh
@@ -1105,7 +1104,6 @@ Example:
$ killall apache $ killall apache
------------------------------- -------------------------------
=item B<klogd> =item B<klogd>
@@ -1127,7 +1125,7 @@ Prints out the length of the specified STRING.
Example: Example:
$ length Hello $ length "Hello"
5 5
------------------------------- -------------------------------
@@ -1152,7 +1150,6 @@ Example:
$ ls -l /tmp/ls $ ls -l /tmp/ls
lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox* lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
------------------------------- -------------------------------
=item B<loadacm> =item B<loadacm>
@@ -1165,7 +1162,6 @@ Example:
$ loadacm < /etc/i18n/acmname $ loadacm < /etc/i18n/acmname
------------------------------- -------------------------------
=item B<loadfont> =item B<loadfont>
@@ -1178,7 +1174,6 @@ Example:
$ loadfont < /etc/i18n/fontname $ loadfont < /etc/i18n/fontname
------------------------------- -------------------------------
=item B<loadkmap> =item B<loadkmap>
@@ -1191,7 +1186,6 @@ Example:
$ loadkmap < /etc/i18n/lang-keymap $ loadkmap < /etc/i18n/lang-keymap
------------------------------- -------------------------------
=item B<logger> =item B<logger>
@@ -1209,8 +1203,7 @@ Options:
Example: Example:
$ logger hello $ logger "hello"
------------------------------- -------------------------------
@@ -1225,7 +1218,6 @@ Example:
$ logname $ logname
root root
------------------------------- -------------------------------
=item B<logread> =item B<logread>
@@ -1309,7 +1301,6 @@ Example:
$ makedevs /dev/hda b 3 0 0 8 s $ makedevs /dev/hda b 3 0 0 8 s
[creates hda,hda1-hda8] [creates hda,hda1-hda8]
------------------------------- -------------------------------
=item B<md5sum> =item B<md5sum>
@@ -1365,7 +1356,6 @@ Example:
/tmp/foo/bar/baz: No such file or directory /tmp/foo/bar/baz: No such file or directory
$ mkdir -p /tmp/foo/bar/baz $ mkdir -p /tmp/foo/bar/baz
------------------------------- -------------------------------
=item B<mkfifo> =item B<mkfifo>
@@ -1417,7 +1407,6 @@ Example:
$ mknod /dev/fd0 b 2 0 $ mknod /dev/fd0 b 2 0
$ mknod -m 644 /tmp/pipe p $ mknod -m 644 /tmp/pipe p
------------------------------- -------------------------------
=item B<mkswap> =item B<mkswap>
@@ -1450,7 +1439,6 @@ Example:
$ ls -la /tmp/temp.mWiLjM $ ls -la /tmp/temp.mWiLjM
-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
------------------------------- -------------------------------
=item B<more> =item B<more>
@@ -1463,7 +1451,6 @@ Example:
$ dmesg | more $ dmesg | more
------------------------------- -------------------------------
=item B<mount> =item B<mount>
@@ -1475,14 +1462,14 @@ Mount a filesystem
Flags: Flags:
-a: Mount all filesystems in fstab. -a: Mount all filesystems in fstab.
-f: Fake Add entry to mount table but don't mount it. -f: "Fake" Add entry to mount table but don't mount it.
-n: Don't write a mount table entry. -n: Don't write a mount table entry.
-o option: One of many filesystem options, listed below. -o option: One of many filesystem options, listed below.
-r: Mount the filesystem read-only. -r: Mount the filesystem read-only.
-t fs-type: Specify the filesystem type. -t fs-type: Specify the filesystem type.
-w: Mount for reading and writing (default). -w: Mount for reading and writing (default).
Options for use with the B<-o> flag: Options for use with the "B<-o>" flag:
async/sync: Writes are asynchronous / synchronous. async/sync: Writes are asynchronous / synchronous.
atime/noatime: Enable / disable updates to inode access times. atime/noatime: Enable / disable updates to inode access times.
@@ -1505,7 +1492,6 @@ Example:
$ mount /dev/fd0 /mnt -t msdos -o ro $ mount /dev/fd0 /mnt -t msdos -o ro
$ mount /tmp/diskimage /opt -t ext2 -o loop $ mount /tmp/diskimage /opt -t ext2 -o loop
------------------------------- -------------------------------
=item B<mt> =item B<mt>
@@ -1534,7 +1520,6 @@ Example:
$ mv /tmp/foo /bin/bar $ mv /tmp/foo /bin/bar
------------------------------- -------------------------------
=item B<nc> =item B<nc>
@@ -1554,7 +1539,6 @@ Example:
quit quit
221 foobar closing connection 221 foobar closing connection
------------------------------- -------------------------------
=item B<nslookup> =item B<nslookup>
@@ -1572,7 +1556,6 @@ Example:
Name: debian Name: debian
Address: 127.0.0.1 Address: 127.0.0.1
------------------------------- -------------------------------
=item B<ping> =item B<ping>
@@ -1598,7 +1581,6 @@ Example:
1 packets transmitted, 1 packets received, 0% packet loss 1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 20.1/20.1/20.1 ms round-trip min/avg/max = 20.1/20.1/20.1 ms
------------------------------- -------------------------------
=item B<pivot_root> =item B<pivot_root>
@@ -1627,11 +1609,10 @@ Where FORMAT controls the output exactly as in C printf.
Example: Example:
$ printf Val=%d $ printf "Val=%d
5 " 5
Val=5 Val=5
------------------------------- -------------------------------
=item B<ps> =item B<ps>
@@ -1798,7 +1779,7 @@ files; if no input files are specified, then the standard input is read.
Example: Example:
$ echo foo | sed -e 's/f[a-zA-Z]o/bar/g' $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
bar bar
------------------------------- -------------------------------
@@ -1831,7 +1812,7 @@ This command does not yet have proper documentation.
Use lash just as you would use any other shell. It properly handles pipes, Use lash just as you would use any other shell. It properly handles pipes,
redirects, job control, can be used as the shell for scripts, and has a redirects, job control, can be used as the shell for scripts, and has a
sufficient set of builtins to do what is needed. It does not (yet) support sufficient set of builtins to do what is needed. It does not (yet) support
Bourne Shell syntax. If you need things like if-then-else, while, and such Bourne Shell syntax. If you need things like "if-then-else", "while", and such
use ash or bash. If you just need a very simple and extremely small shell, use ash or bash. If you just need a very simple and extremely small shell,
this will do the job. this will do the job.
@@ -1858,12 +1839,12 @@ Sorts lines of text in the specified files
Example: Example:
$ echo -e e $ echo -e "e
f f
b b
d d
c c
a | sort a" | sort
a a
b b
c c
@@ -1985,7 +1966,7 @@ Main operation mode:
File selection: File selection:
f name of tarfile or - for stdin f name of tarfile or "-" for stdin
O extract to stdout O extract to stdout
exclude file to exclude exclude file to exclude
X file with names to exclude X file with names to exclude
@@ -2013,7 +1994,7 @@ Options:
Example: Example:
$ echo Hello | tee /tmp/foo $ echo "Hello" | tee /tmp/foo
$ cat /tmp/foo $ cat /tmp/foo
Hello Hello
@@ -2057,14 +2038,14 @@ Example:
tftp command SOURCE DEST tftp command SOURCE DEST
Transfers a file from/to a tftp server using octet mode. Transfers a file from/to a tftp server using "octet" mode.
Commands: Commands:
get Get file from server SOURCE and store to local DEST. get Get file from server SOURCE and store to local DEST.
put Put local file SOURCE to server DEST. put Put local file SOURCE to server DEST.
When nameing a server, use the syntax server:file. When nameing a server, use the syntax "server:file".
------------------------------- -------------------------------
@@ -2086,7 +2067,6 @@ Example:
$ ls -l /tmp/foo $ ls -l /tmp/foo
-rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
------------------------------- -------------------------------
=item B<tr> =item B<tr>
@@ -2104,10 +2084,9 @@ Options:
Example: Example:
$ echo gdkkn vnqkc | tr [a-y] [b-z] $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
hello world hello world
------------------------------- -------------------------------
=item B<true> =item B<true>
@@ -2182,7 +2161,6 @@ Example:
$ uname -a $ uname -a
Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
------------------------------- -------------------------------
=item B<uniq> =item B<uniq>
@@ -2200,12 +2178,12 @@ Options:
Example: Example:
$ echo -e a $ echo -e "a
a a
b b
c c
c c
a | sort | uniq a" | sort | uniq
a a
b b
c c
@@ -2245,7 +2223,6 @@ Example:
$ uptime $ uptime
1:55pm up 2:30, load average: 0.09, 0.04, 0.00 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
------------------------------- -------------------------------
=item B<usleep> =item B<usleep>
@@ -2277,7 +2254,6 @@ Example:
$ ls -l busybox $ ls -l busybox
-rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
------------------------------- -------------------------------
=item B<uuencode> =item B<uuencode>
@@ -2339,7 +2315,6 @@ Example:
$ wc /etc/passwd $ wc /etc/passwd
31 46 1365 /etc/passwd 31 46 1365 /etc/passwd
------------------------------- -------------------------------
=item B<wget> =item B<wget>
@@ -2388,7 +2363,6 @@ Example:
$ ls | xargs gzip $ ls | xargs gzip
$ find . -name '*.c' -print | xargs rm $ find . -name '*.c' -print | xargs rm
------------------------------- -------------------------------
=item B<yes> =item B<yes>
@@ -2562,4 +2536,4 @@ Enrique Zanardi <ezanardi@ull.es>
=cut =cut
# $Id: busybox.pod,v 1.98 2001/04/09 23:27:51 kraai Exp $ # $Id: busybox.pod,v 1.99 2001/04/10 00:00:05 kraai Exp $