Sponsored Content
Full Discussion: Troubleshooting Script
Top Forums Shell Programming and Scripting Troubleshooting Script Post 65355 by vgersh99 on Friday 4th of March 2005 04:37:46 PM
Old 03-04-2005
a few comments:

1. this
Code:
set -A instance
instance[1]="ont0"
instance[2]="qbc1"
instance[3]="jdbc0"
instance[4]="admin1"

can be made with that:
Code:
set -A instance 'ont0' 'qbc1' 'jdbc0' 'admin1'

the same goes for the OTHER array declaration/initialization.
btw, arrays are ZERO-based - not ONE-based

2.
Code:
function setYear{
  if [ ${DATEmonth} == 1 ]
  then
    DATEyear=${DATEyear}-1
  fi
}

DATEyear is declared as integer and should be compared as such.
Code:
if (( DATEmonth == 1 ))

and substraction should be performed as such:
Code:
(( DATEyear = DATEyear -1 ))

3. for your actual error.... - you need either a SPACE between the function name the trailing '{' OR you need to put '{' on a new line:
Code:
function setYear {

OR

function setYear
{

there are other potential problems with the script, but we'll go slow - fix the ones above first and start debugging the output next.

good luck.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tftp troubleshooting

Hi I am trying to do a network install of Solaris 10 08_07 onto a Sunfire T2000. I have configured all my network-boot-arguments on the client server (named sundb1). I have installed my image of Solaris on my install server (sun1). But when I try to install using # boot net -s I get the... (0 Replies)
Discussion started by: Bobby76
0 Replies

2. Shell Programming and Scripting

calling a function in Shell script troubleshooting

Some Code After Some code part is executed the control doesnt go to rvin_doxx_scrt.. and the script exits rvin_doxx_scrt() { Some Code } if (som code) ... (4 Replies)
Discussion started by: ultimatix
4 Replies

3. Solaris

help troubleshooting

Hi. I have a Solaris 10 server that's taking about 20secs to respond to telnet or ftp commands. Has anyone ever seen something like that? Can you tell me where to start troubleshooting please? I logged in and did a prtstat, but nothing is jumping out as an issue. (8 Replies)
Discussion started by: bbbngowc
8 Replies

4. AIX

AIX troubleshooting

Hi guys, Is there a command in AIX similar to ps, but shows memory usage by application? I'm trying to track down a rogue application that's using up all 32GB of the available systems memory and causing the the system to page to disk. (4 Replies)
Discussion started by: bbbngowc
4 Replies

5. Ubuntu

Help with troubleshooting crontab

Hello all, When I configured cron jobs that execute bash scripts a while back on my box they worked and the other day I tried to enable cron jobs that execute a bash script to run with no success. cron text file: test.sh file The script has execution rights (e.g. if I use bash... (2 Replies)
Discussion started by: LAVco
2 Replies

6. AIX

How to Troubleshooting IO in AIX 6.xx

I am running Oracle databases and recently have been facing slow IO response. I know in 11g one can run calibrate_IO from within DB and it would have given me some data for IO, but DB is 10g. Is there any tool available which can give me max MBPS, max IO requests per second system can handle and... (1 Reply)
Discussion started by: clifford
1 Replies

7. AIX

iSCSI troubleshooting

I have an Equallogic SAN that I connect to from AIX (as well as Windows) I had configured the connection and created the volumes and filesystems and all was working great. Then one day, no communication between the SAN and the AIX (I can ping though) Anything I do on the AIX box at this time... (2 Replies)
Discussion started by: oldmanjoe
2 Replies

8. IP Networking

TCP/IP troubleshooting

Hello all, Can somebody please tell what is the best book out there that can help me learn TCP troubleshooting and understaning the TCP options like window scaling, large receive offload? I would like to understand how all the TCP tuning parameters function. Is there a book out there that can... (4 Replies)
Discussion started by: Pouchie1
4 Replies

9. Shell Programming and Scripting

Troubleshooting whiptail

Here is a code snippet using whiptail , it fails to complete giving me long list of options available for whiptail . That is great, but how do I determine which of the current opinions is wrong? I did tried inserting comment (#) into options and it just did not work. Deleting the option... (9 Replies)
Discussion started by: annacreek
9 Replies

10. Linux

Troubleshooting init.d script

This is what I did: 1. I wrote a simple init.d script (myscript.sh) 2. I placed it under /etc/init.d (where many other default scripts already are) 3. Set the perms to 755 4. Run: update-rc.d myscript.sh defaults I can run it perfectly by doing: /etc/init.d/myscript.sh start... (2 Replies)
Discussion started by: rlopes
2 Replies
qassociate(9F)						   Kernel Functions for Drivers 					    qassociate(9F)

NAME
qassociate - associate STREAMS queue with driver instance SYNOPSIS
#include <sys/types.h> #include <sys/stream.h> #include <sys/stropts.h> #include <sys/ddi.h> #include <sys/sunddi.h> int qassociate(queue_t *q, int instance); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). This entry point is required for drivers which export cb_ops(9S) entry points. PARAMETERS
queue_t *q Pointer to a queue(9S) structure. Either the read or write queue can be used. int instance Driver instance number or -1. DESCRIPTION
The qassociate() function associates the specified STREAMS queue with the specified instance of the bottom driver in the queue. Upon suc- cessful return, the stream is associated with the instance with any prior association dissolved. A DLPI style-2 driver calls qassociate() while processing the DL_ATTACH_REQ message. The driver is also expected to call this interface while performing stream associations through other means, such as ndd(1M) ioctl commands. If instance is -1, the stream is left unassociated with any hardware instance. If the interface returns failure, the stream is not associated with the specified instance. Any prior association is left untouched. The interface typically fails because of failure to locate and attach the device instance. The interface never fails if the specified instance is -1. CONTEXT
qassociate() can be called from the stream's put(9E) entry point. RETURN VALUES
0 Success. -1 Failure. EXAMPLES
A Style-2 network driver's DL_ATTACH_REQ code would specify: if (qassociate(q, instance) != 0) goto fail; The association prevents Dynamic Reconfiguration (DR) from detaching the instance. A Style-2 network driver's DL_DETACH code would specify: (void) qassociate(q, -1); This dissolves the queue's association with any device instance. A Style-2 network driver's open(9E) code must call: qassociate(q, -1); This informs the framework that this driver has been modified to be DDI-compliant. SEE ALSO
dlpi(7P), open(9E), put(9E), ddi_no_info(9F), queue(9S) SunOS 5.10 9 Jul 2002 qassociate(9F)
All times are GMT -4. The time now is 11:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy