SunQuest
           UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old September 14th, 2004, 06:51 AM
levonk levonk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 levonk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dtksh script fails in other accounts

I wrote a dtksh script that runs in my unix account, but it fails to run in any other identical account on the same server.
The script doesn't use any account specific parameters but rather gets all the data from the environment variables that
are similarly defined in any other account on the machine. It's completely generic.
The server is running Unix system HP-UX B.11.11 .
Thanks.

Reply With Quote
  #2  
Old September 14th, 2004, 03:48 PM
Perderabo Perderabo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 121 Perderabo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 54 sec
Reputation Power: 5
"fails to run"? Sounds like it's executable only by the owner. "chmod 555 scriptname"

Reply With Quote
  #3  
Old September 15th, 2004, 02:19 AM
levonk levonk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 levonk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I do change the mode with "chmod 0755", and I've also tried the proposed "chmod 555" but in vain. The error message that appears while trying to run the script is :

"./txttest[81]: XtCreateManagedWidget: =W24: is not an identifier ".

The line 81 of the script is :

5) ShowCallback()
6) {}
.
.
.
80) ################# Create the GUI ##########
81)
82) XtInitialize TOPLEVEL ratermode Dtksh $0 "${@:-}"
83) XtSetValues $TOPLEVEL title:"Rater Mode Setup"
84) XtCreateManagedWidget FORM form XmForm $TOPLEVEL

Reply With Quote
  #4  
Old September 15th, 2004, 10:47 AM
Perderabo Perderabo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 121 Perderabo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 54 sec
Reputation Power: 5
"${@:-}" is pretty weird, but dtksh seems to accept it. What is the purpose of that ':-' in the expression? You might try "$@" anyway. By doing either, you let the user pass stuff to the Xt toolkit. I stop after the $0 unless I have good reason not to. These other users could have an alias or function set that is passing strange args into the script. Do a
echo args = "$@"
on the top to be sure that is not happening.

Doesn't your XtCreateManagedWidget have any resources set? If so, post the whole command.

But I really don't see anything that could cause the problem...

Reply With Quote
  #5  
Old September 19th, 2004, 07:03 AM
levonk levonk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 levonk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
Thank you for the reply.

1) "What is the purpose of that ':-' in the expression?" - I really don't know.
2) "You might try "$@" anyway" - I've tried but without success.
3) " echo args = "$@" " - no arguments are passed to the script.
4) "... XtCreateManagedWidget have any resources set? " - NO.

Here is the main part of the script. May be this will help to figure out the problem.
######################################################
#! /usr/dt/bin/dtksh

. /usr/dt/lib/dtksh/DtFuncs.dtsh

ShowCallback()
{

XtGetValues $PRESUBSCR menuHistory:PRESUBSCR_VAL
case $PRESUBSCR_VAL in
$A1) CURRENT=${V[1]} ;;
$A2) CURRENT=${V[2]} ;;
$A3) CURRENT=${V[3]} ;;
$A4) CURRENT=${V[4]} ;;
$A5) CURRENT=${V[5]} ;;
$A6) CURRENT=${V[6]} ;;
$A7) CURRENT=${V[7]} ;;
$A8) CURRENT=${V[8]} ;;
esac

################## Customer Number ######################

TMP=0
TMP=`ttIsql -v 1 -connStr DSN=dmmwrk${ENV_NUM}_550MMMF_65S_A << EOF
select customer_id from table_01 where subscriber_no=$CURRENT and resource_type='C';

EOF`

CUST=`echo $TMP | sed -e 's/>//' -e 's/<//' `
XmTextSetString $CUSTOMER_NO $CUST
}

##################### Create the GUI ########################

XtInitialize TOPLEVEL ratermode Dtksh $0
XtSetValues $TOPLEVEL title:"Rater Mode Setup"

XtCreateManagedWidget FORM form XmForm $TOPLEVEL


##################### Account Fields #####################

XtCreateManagedWidget ACCLABEL acclabel XmLabel $FORM \
labelString:"Account Number:" \
$(DtkshAnchorTop 12) \
$(DtkshAnchorLeft 10)

XtCreateManagedWidget ACCTEXT acctext XmText $FORM \
columns:10 \
value:ammwrk${ENV_NUM} \
$(DtkshAnchorTop 6) \
$(DtkshRightOf $ACCLABEL 10)


#################### Separator Line 3 ######################

XtCreateManagedWidget SEP3 sep3 XmSeparator $FORM \
separatorType:SINGLE_DASHED_LINE \
$(DtkshUnder $ACCTEXT 10) \
$(DtkshSpanWidth)

############ Pulldown Menu to Choose a Subscriber ###########

ID=`ttIsql -v 1 -connStr "DSN=ammwrk${ENV_NUM}_550Maf_64S_A" -f PreSubscrId.sql | sed -e 's/>//' -e 's/<//' `
echo $ID |read V[1] V[2] V[3] V[4] V[5] V[6] V[7] V[8] V[9] V[10] V[11] V[12] V[13] V[14] V[15] V[16] V[17] V[18] V[19] V[20] V[21] V[22] V[23] V[24] V[25] V[26] V[27] V[28] V[29] V[30]

XmCreatePulldownMenu PANE $FORM pane
DtkshAddButtons -w $PANE XmPushButtonGadget \
A1 ${V[1]} "" A2 ${V[2]} "" A3 ${V[3]} "" A4 ${V[4]} "" A5 ${V[5]} "" \
A6 ${V[6]} "" A7 ${V[7]} "" A8 ${V[8]} ""

XmCreateOptionMenu PRESUBSCR $FORM presubscr \
labelString:"Choose a Prepaid Subscriber ID :" \
menuHistory:$A1 \
subMenuId:$PANE \
$(DtkshUnder $SEP1 20) \
$(DtkshSpanWidth 10 10)
XtManageChild $PRESUBSCR

XtCreateManagedWidget SHOW show XmPushButton $FORM \
labelString:"SHOW DETAILS" \
$(DtkshUnder $PRESUBSCR 10) \
$(DtkshAnchorLeft 100)
XtAddCallback $SHOW activateCallback "ShowCallback"

#################### Separator Line 2 #######################

XtCreateManagedWidget SEP2 sep2 XmSeparator $FORM \
separatorType:SINGLE_DASHED_LINE \
$(DtkshUnder $SHOW 20) \
$(DtkshSpanWidth)

#########################################################

XtRealizeWidget $TOPLEVEL
XtMainLoop

Reply With Quote
  #6  
Old September 20th, 2004, 10:44 AM
Perderabo Perderabo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 121 Perderabo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 54 sec
Reputation Power: 5
I won't be able to run that since I don't have your database.

Just eyeballing it, this seems illegal:
XmCreateOptionMenu PRESUBSCR $FORM presubscr \
labelString:"Choose a Prepaid Subscriber ID :" \
menuHistory:$A1 \
subMenuId:$PANE \
$(DtkshUnder $SEP1 20) \

But you have have simply omitted the code that defines the SEP1 widget as you copied it to the post.

Since the FORM widget has no resources, I simply do not believe that it is the cause of the error. That [81] is just misleading you. Put a debug statement like:
echo creating acclabel widget >&2
in front of every XtCreateManagedWidget call. This should tell you which widget has the problem.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Dtksh script fails in other accounts


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway