Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Tom Leitner <tom@radar.tu-graz.ac.at>
Subject: Tru64 Unix: dtksh acting weird ....
Date: 2000/03/02	[thread overview]
Message-ID: <89l5q6$rn2$1@fstgss02.tu-graz.ac.at> (raw)

[ This is a repost of the following article:                               ]
[ From: Tom Leitner <tom@radar.tu-graz.ac.at>                              ]
[ Subject: Tru64 Unix: dtksh acting weird ....                             ]
[ Newsgroups: comp.unix.cde                                                ]
[ Message-ID: <89hb06$iu$1@fstgss02.tu-graz.ac.at>                         ]

[ This is a repost of the following article:                               ]
[ From: Tom Leitner <tom@radar.tu-graz.ac.at>                              ]
[ Subject: Tru64 Unix: dtksh acting weird ....                             ]
[ Newsgroups: comp.unix.shell                                              ]
[ Message-ID: <89gb6a$le9$1@fstgss02.tu-graz.ac.at>                        ]

Hello,

I've implemented a short dtksh script, appended below, which allows me to
move certain windows on the CDE desktop to other workspaces automatically.
This works without problems under Solaris 2.6 and Solaris 7.

However I just can't get it to work under Tru64 4.0e,f and 5.0.

It get all sorts of weird error messages which lead me to the conclusion
that the script is somehow just cut off internally. The error messages
depend, for instance on how many comment lines I've put at the beginning
of the file.

Here's what I get with the unmodified file below:

$ cdesetws.sh xterm 2
cdesetws.sh: line 34: syntax error at line 39: ``' unmatched  

Any ideas anyone? I've tried for more than 2 hours now without any
success. Is dtksh broken under Tru64?

Thanks // Tom

P.S: Here's the script. Under Solaris, it can be tested by starting
     an xterm with "xterm &". The xterm window can then be moved to,
     say, workspace #2 with "cdesetws.sh xterm 2"

-------------- cdesetws.sh -----------
#!/usr/dt/bin/dtksh
# $Id: cdesetws.sh,v 1.1 2000/02/29 11:28:10 tom Exp $
# ---------------------------------------------------------------------------
#
# File:  cdesetws.sh
# Desc:  Move an existing window by name to a specified CDE workspace.
# Usage: cdesetws.sh <window-name> <workspace-number>
#
# $Log: cdesetws.sh,v $
# Revision 1.1  2000/02/29 11:28:10  tom
# Initial revision
#
# ---------------------------------------------------------------------------
#
if [ $# -ne 2 ]; then
    echo 'Usage: cdesetws.sh <window-name> <workspace-number>'
    exit 1
fi
wname=$1
wsn=$2
#
# get the window number
#
XWI=`which xwininfo`
echo $XWI | grep found >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
    XWI=
    if [ -x /usr/bin/X11/xwininfo ]; then
        XWI=/usr/bin/X11/xwininfo
    fi
    if [ -x /usr/openwin/bin/xwininfo ]; then
        XWI=/usr/openwin/bin/xwininfo
    fi
    if [ "$XWI" = "" ]; then
        echo "** ERROR: cdesetws.sh cannot find xwininfo !!"
        exit 1
    fi
fi
WIN=`$XWI -name $wname 2>/dev/null | grep "Window id:" | awk '{ print $4 }'`
if [ "$WIN" = "" ]; then
    echo "** ERROR: cdesetws.sh cannot find window name $wname !!"
    exit 1
fi
#
# init X and move the window.
#
XtInitialize TOPLEVEL cdesetws Dtksh $0 2>/dev/null
XtDisplay DISP $TOPLEVEL
XtScreen SCREEN $TOPLEVEL
XRootWindowOfScreen RWIN $SCREEN
DtWsmGetWorkspaceList $DISP $RWIN WSALL
if [ "$WSALL" != "" ]; then
    WS=`echo $WSALL | tr , "\\n" | head -$wsn | tail -1`
    DtWsmSetWorkspacesOccupied $DISP $WIN $WS
fi
XFlush $DISP
XSync $DISP false
exit 0
#
# end of file

-- 
Dr. Tom Leitner             Dept. of Communications, Graz Univ. of Technology,
tom@radar.tu-graz.ac.at     Inffeldgasse 12, A-8010 Graz / Austria / Europe
PGP public key @ http://wiis.tu-graz.ac.at/people/tom.html



                 reply	other threads:[~2000-03-02  5:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox