I thought I'd start this thread so people can post their DOS scripts here.
Please only post working scripts and a short description of what they do and how to use them.
This one does a complete flush and reports the totals at the end
usage: cut'n'paste it in notepad, save it as c:fullflush, open a shell and 'protect c:fullflush +s' then just enter 'fullflush' to run it...
-------------------------------------------------
echo Flushing... set original `avail virtual` lab loop set before `avail virtual` set after `avail virtual flush` set freed `eval $after - $before / 1024` echo Flushed: $freed kb. if $freed EQ 0 skip done endif skip loop back
lab done echo "" echo Free ram before flush: `eval $original / 1024` kb. echo Free Ram after flush: `eval $after / 1024` kb. set freed `eval $after - $original / 1024` echo ram freed: $freed kb. unset original unset before unset after unset freed
Amiga user since 1985 AOS4, A-EON, IBrowse & Alinea Betatester
here a small primitive script I did to allow me to sleep a few minutes and wake up with the music I choose. You should edit the path to Amigaamp or choose another player if you want !
hmmm... redirecting output to env is a bit naughty, you could use
setenv n `requeststring <blah> <blah>`
or
requeststring <blah> <blah> TO env:n
I prefer to use the set, get & unset commands as they just store variables in memory instead of using a device. ie.
set n `REQUESTSTRING "Wake Up" "How many minutes do you want to sleep?"` IF $n EQ "" QUIT ELSE set m `REQUESTFILE TITLE="Choose your music"` WAIT min $n YOURPATH:amigaamp/amigaamp $m ENDIF unset n unset m
Amiga user since 1985 AOS4, A-EON, IBrowse & Alinea Betatester
[joke] delete sys:kickstart#? all force reboot [/joke]
While you shouldn't perform the above, and can be seen as humourous, it does highlight how powerful dos is and how easily a naughty script could render an os4 machine non bootable.
Thank you for your suggestions... as I said, I am an eternal newbie
Now another script. You know that the latest Pagestream for OS4 PPC can only print to postscript. What if you don't have it ? Print to a file into RAM, name it out.ps and run my script, then print with AmiPDF. I know, Pagestream can export directly into PDF, but if you go through PDF, it gives better results. You can use the Acrobat.Distiller PPD that comes with Pagestream.
if so, then someone could do an alias something like:
Quote:
alias mkpdf "ps2pdf -dEmbedAllFonts=true -dUseFlateCompression=true -sPAPERSIZE=Letter"
Of course you would modify the PAPERSIZE option to fit your own paper, and the syntax to work with OS4's terminal/shell.
I use it on my Ubuntu machine to make PDFs of my writings because I have niggling problems with OpenOffice2's PDF export function (it won't include characters entered through the insert character dialog in the PDF output, but it will include them in the postscript output; go figure).
I used to have a DOS script that I used to back up my A1200 when it was still working. It copied everything over to a special partition that I used to burn CD-R back ups. Worked a treat, but obviously, I don't have that close at hand right now.
For those who are brave enough to want to know me better, visit my Home Page, my Storefront, and blogsey