home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 3
/
CDPDIII.bin
/
fish
/
811-820
/
ff811
/
bsh
/
nice
< prev
next >
Wrap
Text File
|
1993-02-14
|
1KB
|
30 lines
# nice - run a command in its own cli at a low priority. The "read a"
# causes the spawned cli to wait for the user to type a newline before
# closing the window and terminating. The '/close/wait' are window flags
# new to DOS2.0; if running on a DOS 1.3 system, uncomment the three lines:
# onerr ..., # label ..., # read ...
#
# nice is presented as is; no warrantee is either expressed or implied
# as to it's suitability to any purpose whatsoever. You assume all the
# risk for all damage even if caused by a defect in the software, no matter
# how awful.
# local window="cnc:0/0/640/101/$*/sa" # use a conman (non-activating) window.
local window="con:0/0/640/101/$*/close/wait" # or maybe not.
if !?nice_num
nice_num=0
endif
cat >t:nice$$.$nice_num.job << +
# onerr "echo status=$status, errno=$errno;goto done"
ChangeTaskPri -5
set cmd "$*"
echo $cmd # better than turning on verbosity
$cmd
# label done
# read a # not necessary on DOS 2.0 systems due to WAIT flag
+
newbsh $window -c source t:nice$$.$nice_num.job $*
nice_num++
sleep .1 # allow time for child to get its window open
window activate # re-activate our own window
exit 0