07-10-2001
does this variable call work--Korn
I am new to the UNIX environment, but not to programming. My intention is to create a 2D array and print it. Since the Korn Shell does not support that kind of variable, the following is my solution right now.
I have created a group of variables as follows:
table00
table01
table02
table10
table11
.
.
.
tablenn
My run into a brick wall when trying to print I have tried to display these variables with:
i=0
j=0
while [[ $i -lt $n ]]
do
while [[ $j -lt $n ]]
do
print "${table$i$j} "
let j=j+1
done
done
The above print command above does not print the value of table00, table01, etc. I get an error message saying that I am attempting to perform a substitution. I know this is something dumb on my part, but I would really appreciate any solutions or thoughts.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
in a text " Korn Shell Unix programming Manual 3° Edition"
i have found this sintax to declare a compoud variable:
variable=(
fild1 (0 Replies)
Discussion started by: ZINGARO
0 Replies
2. Shell Programming and Scripting
in a text " Korn Shell Unix programming Manual 3° Edition"
i have found this sintax to declare a compoud variable:
variable=(
fild1
fild1
)
but this sintax in ksh and sh (HP-UNIX) not work...
why?? exist another solution for this type of variable ??? (5 Replies)
Discussion started by: ZINGARO
5 Replies
3. HP-UX
As per the man page, pstat_getdisk() call returns the number of instances, which could be 0 upon successful completion, otherwise a value of -1 is returned.
Please have a look at this sample program ->
#include <stdio.h>
#include <sys/pstat.h>
int main()
{
int j = 0, ret;
struct... (2 Replies)
Discussion started by: sandiworld
2 Replies
4. AIX
On AIX 5.3 host, the lvm_queryvg call does not work properly and results in a sudden memory rise. This is happening on one particular host and the call works fine on another host.
Is this a known issue and is there any patch available for this? (0 Replies)
Discussion started by: sandiworld
0 Replies
5. Shell Programming and Scripting
I have a cgi script that calls a perl script (A.pl) to do something in backgroup, when run that perl script in command everything works fine, but when it calls by the CGI script, nothing works. I have tried another perl script (B.pl not cgi) calls A.pl, and it works fine.
The A.pl is chmod 777, ... (6 Replies)
Discussion started by: tqlam
6 Replies
6. Shell Programming and Scripting
I am trying to use a pattern-list match in korn shell using a variable and it always seems to regard the pattern-list as a literal:
Using the directory names explicitly in the pattern-list works fine:
ls @(test|test1)/test.txt
and returns:
test/test.txt
Trying to use a variable for this... (2 Replies)
Discussion started by: partchimp
2 Replies
7. Shell Programming and Scripting
#!/bin/sh
APP_ROOT_MODE1=/opt/app1.0
APP_ROOT_MODE2=/opt/app2.0
APP_ROOT=${APP_ROOT_${APP_MODE}}
# enviornment variable APP_MODE will be exported in the terminal where
# we run the applciation, its value is string - MODE1 or MODE2
# My intension is:
# when export APP_MODE=MODE1... (4 Replies)
Discussion started by: princelinux
4 Replies
8. Shell Programming and Scripting
I am using two shell scripts a.ksh and b.ksh
a.ksh
1. Sets the value
+++++++++++++++++
export USER1=abcd1
export PASSWORD=xyz
+++++++++++++++++
b.ksh
2. Second scripts calls sctipt a.ksh and uses the values set in a.ksh and pass to an executable demo... (2 Replies)
Discussion started by: kunalseth
2 Replies
9. Programming
Hi
I have the following block of code in korn shell and don't now how to refer to variable `print variable1.$dvd` ?
---
integer dvd=4
integer number=0
while (( dvd!=0 ))
do
print "Iteracja numer : $dvd"
print "$_" #it refers to $dvd var but want to refer... (3 Replies)
Discussion started by: presul
3 Replies
10. AIX
My first post evidently did not materialize so I posted it again:
Runnning a cron job every 5 mins to send data files to a state facility.
My original cron entry at worked fine:
01,06,11,16,21,26,31,36,41,46,51,56 * * * * /home/sftpuser/stateinoc-from-appname.ksh
Somewhere I have a... (1 Reply)
Discussion started by: Skyybugg
1 Replies
LEARN ABOUT REDHAT
xmprintpopuppdm
XmPrintPopupPDM(library call) XmPrintPopupPDM(library call)
NAME
XmPrintPopupPDM -- Send a notification for the PDM to be popped up
SYNOPSIS
#include <Xm/Print.h>
XtEnum XmPrintPopupPDM(
Widgetprint_shell,
Widgetvideo_transient_for);
DESCRIPTION
A convenience function that sends a notification to start a Print Dialog Manager on behalf of the application, XmPrintPopupPDM hides the
details of the X selection mechanism used to notify the PDM that a new dialog must be popped up for this application.
XmPrintPopupPDM sends a selection request to either the print display of the print shell, or the video display of the transient_for video
widget (depending on the environment variable XPDMDISPLAY, which can only takes the value "print" or "video"), asking for the PDM windows
to be popped up on behalf of the app.
Return right away with status of XmPDM_NOTIFY_FAIL (e.g. if the function couldn't malloc memory for the selection value, or if XPDMDISPLAY
is not "print" or "video") or with XmPDM_NOTIFY_SUCCESS , which only means a "message" was sent out to the PDM specified by XPDMSELECTION ,
not that it's already up on the screen yet.
In order to know if the PDM is up, or not running, the application must register a XmNpdmNotificationCallback with the Print Shell.
XmPrintPopupPDM puts up an InputOnly window on top of the dialog, so that the end user doesn't use the print setup dialog while the PDM is
trying to come up. This window is automatically removed when the shell is about to call the callback for the first time.
print_shell
The Print Shell used for this print job and context.
video_transient_for
The video widget dealing with application print setup.
RETURN VALUE
Returns XmPDM_NOTIFY_SUCCESS if the function was able to send the notification out to the PDM process, XmPDM_NOTIFY_FAIL otherwise.
ERRORS
/WARNINGS
Not applicable.
EXAMPLES
Example of callback from a Print set up dialog box "Setup..." button:
PrintSetupCallback(print_dialog...)
/*-------------*/
{
if (XmPrintPopupPDM (pshell, XtParent(print_dialog)) !=
XmPDM_NOTIFY_SUCCESS) {
/* some error dialog */
}
}
Example of XmNpdmNotificationCallback from a Print Shell:
pdmNotifyCB(print_shell...)
{
XmPrintShellCallBackStruct * pr_cb = ...
switch (pr_cb->reason) {
case XmCR_PDM_NONE:
/* no PDM available */
PostErrorDialog(...);
break;
case XmCR_PDM_VXAUTH:
/* PDM is not authorized ... */
PostErrorDialog(...);
break;
case XmCR_PDM_UP: the PDM is up and running
/* everything is fine */
break;
default: /* other cases */
}
}
SEE ALSO
XmPrintSetup(3), XmPrintShell(3), XmRedisplayWidget(3), XmPrintToFile(3)
XmPrintPopupPDM(library call)