| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| From: | "Hannu E K Nevalainen \(garbage mail\)" <garbage_collector AT telia DOT com> |
| To: | <cygwin AT cygwin DOT com> |
| Subject: | To create a SYSTEM-owned bash prompt (RE: problem of cron in cygwin xp) |
| Date: | Tue, 30 Sep 2003 21:29:04 +0200 |
| Message-ID: | <NGBBLLIAMFLGJEOAJCCECELHDEAA.garbage_collector@telia.com> |
| MIME-Version: | 1.0 |
| X-Priority: | 3 (Normal) |
| X-MSMail-Priority: | Normal |
| X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2800.1165 |
| Importance: | Normal |
| In-Reply-To: | <Pine.GSO.4.56.0309301343330.26607@slinky.cs.nyu.edu> |
| Note-from-DJ: | This may be spam |
------=_NextPart_000_001E_01C38799.DF543650
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Feel free to include the attached script wherever it "fits".
/Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E
-- UTC+01, DST -> UTC+02 --
--END OF MESSAGE--
------=_NextPart_000_001E_01C38799.DF543650
Content-Type: application/octet-stream;
name="sysbash"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="sysbash"
#!/bin/bash=0A=
=0A=
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=0A=
# (C) 2003 by Hannu E K Nevalainen, Mariefred, Sweden=0A=
# Written 2003-09-30.=0A=
# Free to use under any circumstances.=0A=
# Requires the "cygwin" Unix-on-windows emulation.=0A=
#=0A=
# This will launch a "SYSTEM" owned bash-prompt in a console window=0A=
# at next even minute boundary, according to the windows "clock".=0A=
# -NO- options available.=0A=
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=0A=
=0A=
if [ -z "`which at`" ] ;then=0A=
echo -e "\nCan't locate the wind-dos \"at.exe\" command."=0A=
echo "At this writing it is unknown whether it exists in Win9x."=0A=
echo -e "\n\e[41m SCRIPT TESTING HAS BEEN DONE UNDER Win2K, SP4+ ONLY =
\e[m\a\n"=0A=
exit 1=0A=
fi=0A=
=0A=
=0A=
# Build the WINDOWS command line to execute=0A=
#------------------------------------------=0A=
# NOTE: Windows paths DOESN'T need backslash escape conversion!=0A=
c=3D"`which bash`"=0A=
c=3D"`cygpath -aw $c` --login -i"=0A=
c=3D"cmd /c \"$c\""=0A=
=0A=
# Launch it at NEXT while minute...=0A=
#----------------------------------=0A=
# find out current HH:MM -> h m =0A=
h=3D`date +%H`=0A=
m=3D`date +%M`=0A=
=0A=
# Increase m one step (possibly flipping the hour)=0A=
if [ $m -gt 58 ] ;then=0A=
m=3D'0'=0A=
h=3D$(( ( $h + 1 ) % 24 ))=0A=
else=0A=
m=3D$(( $m + 1 ))=0A=
fi=0A=
=0A=
# Right adjust and zero fill=0A=
h=3D"00$h"=0A=
h=3D${h: -2}=0A=
m=3D"00$m"=0A=
m=3D${m: -2}=0A=
=0A=
# Initiate launch, assuming "at" is in the PATH=0A=
#----------------------------------------------=0A=
at $h:$m /interactive $c=0A=
=0A=
# Display result=0A=
#---------------=0A=
at=0A=
echo "at id-number /delete # <- this will remove a badly set job"=0A=
------=_NextPart_000_001E_01C38799.DF543650
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
------=_NextPart_000_001E_01C38799.DF543650--
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |