Re: [PATCH] do not eject USB flash drives
Am Samstag, 07. Februar 2009 schrieb Daniel Baumann:
> + while read DEVICE MOUNT REST; do
> + if [ "${MOUNT}" == "/live/image" ]
> + then
> + echo "${DEVICE}"
> + exit 0
> + fi
> + done < /proc/mounts
>
> wrong indenting; this is covered in the manual.
What exactly is wrong with the indenting? I used only tabs. To quote
http://live.debian.net/manual/html/indenting.html:
"Always use tabs and not spaces."
>> What does 'sh -n' do?
>syntax check.
Does not seem to work. Example with a little stupid nonsense script:
-----------
ronny@ronny-desktop:/tmp$ cat test.sh
#!/bin/sh
if [ $blah == "test"]
then
echo "teste mich!"
fi
ronny@ronny-desktop:/tmp$ sh -n test.sh
ronny@ronny-desktop:/tmp$ sh test.sh
[: 5: missing ]
ronny@ronny-desktop:/tmp$
-----------
So, the syntax check does not produce any output, but execution obviously
fails...
>> What on earth is 'checkbasishm'?
>http://packages.debian.org/search?searchon=contents&keywords=checkbashisms&mode=path&suite=unstable&arch=any
Aargh, good old typos... Attached is a patch for the manual that fixes the
typo.
Regards
Ronny
--
Ronny Standtke Fachhochschule Nordwestschweiz
Dozent Medienpädagogik / ICT Pädagogische Hochschule
Telefon: +41 32 627 92 47 Obere Sternengasse 7
Mobil : +41 79 786 81 82 4502 Solothurn
diff --git a/xml/chapters/coding-style.xml b/xml/chapters/coding-style.xml
index 7c3e6e0..f80f34c 100644
--- a/xml/chapters/coding-style.xml
+++ b/xml/chapters/coding-style.xml
@@ -14,7 +14,7 @@
<itemizedlist>
<listitem>Don't use bashisms, e.g. no arrays.</listitem>
<listitem>Only use posix subset, e.g. use $(foo) rather than `foo`.</listitem>
- <listitem>Do check your scripts with 'sh -n' and 'checkbasishm'.</listitem>
+ <listitem>Do check your scripts with 'sh -n' and 'checkbashisms'.</listitem>
</itemizedlist>
</sect1>
Reply to: