Re: Script to help users to report a BUG

randy_dunlap
2005-06-23T17:33:46Z

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

On Thu, 23 Jun 2005 14:06:26 +0200 Micha__ Piotrowski wrote:

| Hi,
|
| Here is new "big" version:
| http://stud.wsi.edu.pl/~piotrowskim/files/ort/ort-a7.tar.bz2
|
| Changes... You will see ;).
|
| Todo:
| raport sending!!!
|
| Thans for patches.

Here are more comments and a patch for you (attached).

ver. a7:

output file with '/' didn't work for me; changed to hyphens;
just one one tmp file name (not several p?.txt);
write the input TXT lines to the temp file before calling editor;
remove the tmp file at end;

I think that the editor and email client Q&A is overkill.

---
~Randy

[-- Attachment #2: ort.sh.a7.patch --]
[-- Type: application/octet-stream, Size: 2637 bytes --]

--- ort.sh.a7 2005-06-23 04:59:29.000000000 -0700
+++ ort.sh 2005-06-23 10:14:33.000000000 -0700
@@ -16,7 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

-ORT_F=ort_oops-`date +%x`.txt
+ORT_F=ort_oops-`date +%F`.txt
VER=v.a7

M_EMAIL=a@b.c
@@ -128,9 +128,9 @@
done
}

-if [[ -f p?.txt ]]
+if [[ -f ortmp.txt ]]
then
- rm p?.txt
+ rm ortmp.txt
fi

if [[ -z "$1" || "$1" = "--help" ]]
@@ -154,21 +154,24 @@
echo "[1.] One line summary of the problem: (press Return to continue)"
echo -e "\n[1.] One line summary of the problem:" >> $ORT_F
read TXT
-$EDITOR p1.txt
-cat p1.txt >> $ORT_F
+echo $TXT > ortmp.txt
+$EDITOR ortmp.txt
+cat ortmp.txt >> $ORT_F

echo "[2.] Full description of the problem/report: (press Return to continue)"
echo -e "\n[2.] Full description of the problem/report:" >> $ORT_F
read TXT
-$EDITOR p2.txt
-cat p2.txt >> $ORT_F
+echo $TXT > ortmp.txt
+$EDITOR ortmp.txt
+cat ortmp.txt >> $ORT_F

echo "[3.] Keywords (i.e., modules, networking, kernel): (press Return to continue)"
echo -e "\n[3.] Keywords (i.e., modules, networking, kernel):" >> $ORT_F
read TXT
+echo $TXT > ortmp.txt
#TOPIC=$TXT
-$EDITOR p3.txt
-cat p3.txt >> $ORT_F
+$EDITOR ortmp.txt
+cat ortmp.txt >> $ORT_F

echo -e "\n[4.] Kernel version (from /proc/version):" >> $ORT_F
cat /proc/version >> $ORT_F
@@ -179,8 +182,9 @@
echo -e "\n[6.] A small shell script or example program which triggers the problem (if possible): (press Return to continue)"
echo -e "\n[6.] A small shell script or example program which triggers the problem (if possible):" >> $ORT_F
read TXT
-$EDITOR p6.txt
-cat p6.txt >> $ORT_F
+echo $TXT > ortmp.txt
+$EDITOR ortmp.txt
+cat ortmp.txt >> $ORT_F

echo -e "\n[7.] Environment" >> $ORT_F

@@ -276,8 +280,14 @@
echo -e "\n[9.] Other notes, patches, fixes, workarounds: (press Return to continue)"
echo -e "\n[9.] Other notes, patches, fixes, workarounds:" >> $ORT_F
read TXT
-$EDITOR p9.txt
-cat p9.txt >> $ORT_F
+echo $TXT > ortmp.txt
+$EDITOR ortmp.txt
+cat ortmp.txt >> $ORT_F
+
+if [[ -f ortmp.txt ]]
+ then
+ rm ortmp.txt
+fi

END=0
while [ $END = 0 ]
@@ -345,8 +355,8 @@
done
elif [ $TXT = "N" ] || [ $TXT = "n" ]
then
- echo -e "\nPlease email $ORT_F to linux-kernel@vger.kernel.org or "
- echo -e "some other appropriate Linux mailing list."
+ echo -e "\nPlease email $ORT_F to linux-kernel@vger.kernel.org "
+ echo -e "or some other appropriate Linux mailing list."
END=1
fi
-done
\ No newline at end of file
+done