Bad and wrong?

Aug 09, 2007 11:15

Using bash to generate DOS shell commands.

New icon

geek, work

Leave a comment

Comments 11

parallelgirl August 9 2007, 10:20:37 UTC
I have no idea what you are talking about.
But, I had to comment anyway, to say: cute icon!

Reply


bluehelen August 9 2007, 10:44:00 UTC
Like the icon, that's a very you smirk. Boo Meevie tomorrow?

Reply

mattp August 9 2007, 11:43:25 UTC
Ooh, yeah, probably. This past month has flown by.

Reply


figg August 9 2007, 10:44:05 UTC
Not bad and wrong, just the best of a bad situation. The dos shell is pitiful and won't let you write grotesque things like this:

echo "Connections, Average, Min, Max" ; ((for a in dos*Fri*; do echo -n `echo $a | sed 's/dos\(.*\)-.*/\1/'` ; grep time $a | cut -d' ' -f 3 | perl -e '($min,$max,$a,$t)=(65535,0,0,0); while (<>) {chomp; next if $_ eq ""; $a += $_; $t++; $max=$_ if ($_ > $max); $min = $_ if ($_ < $min);} print ", ".($a/$t).", $min, $max\n";' ; done) | sort -n)

or this:

for a in * ; do if [[ -d $a ]] ; then cd $a ; A=`ls| grep tr.xml$`; if [[ -z $A ]]; then tr.enum -x `ls|grep nmap.xml` -X tr.xml > tr.log ; fi ; cd ..; fi; done

Reply

mattp August 9 2007, 11:39:05 UTC
L=8 B=B T=D H=m S== D=5000; fn() { printf $B; x=0; while [ $x -lt $L ]; do
if [ $x -eq $X ]; then printf $H; else printf $S; fi; x=$((x+1)); done;
printf $T"\n"; }; Z=1 X=0; while [ 1 ]; do clear; fn; X=$((X+Z));
if [ $((L-1)) -eq $X ]; then Z=-1; fi; if [ 0 -eq $X ]; then Z=1; fi; d=0;
while [ $d -lt $D ]; do d=$((d+1)); done; done
is comically obscene.

For simplicity, I quite like
:(){ :|:&};:
Don't try running it though

Reply


dougs August 9 2007, 11:08:08 UTC
If I had a version of the DOS command interpreter that did command substitution, ...

Cygwin is my friend.

Reply

topbit August 9 2007, 11:49:11 UTC
I wonder if 4dos works on XP? I've got cygwin's bash setup myself.

Reply


plushy August 9 2007, 15:26:25 UTC
Very nice icon, for a second there I thought it was Jake Gyllenhaal!

Reply


Leave a comment

Up