Taking into account the earlier postings and error messages you will have seen during testing, by now your shell script should look something vaguely like this example:
The first line (the shebang line) states which shell we are using.
Indentation adds to readability.
We have appended an arbitary character "X" to "$sales" in the while statement to avoid the syntax error when we finally don't enter a value and want to exit the loop. (There are other ways of achieving the same effect).
For completeness and readablility we initialise $total .
We can extend the "echo" statements to improve the layout on the screen and to provide more information about what the output means. The "\c" in the first echo stops echo outputting a newline character such that the user enters the answer on the same line as the question.
Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
HPUX 11i v2 #!/bin/sh
Hi all.
I have a space delimited flat file of about 9000 lines. I would like to get a running total of field 3 to the variable $TOTAL. Field 3 can be formatted as listed....
$ 0.00
$2804.15
<$ 4.14> (negative)
Any ideas are most appreciated!!!! TIA!! (9 Replies)
Hi,
i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell.
How do i distinguish whether my script is run by init process or by shell??
Will the command
/proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Hello.
I have a status command in AIX box, which provides output as below:
$ status
You are running the application on pegasus2
----Program Name------|--Avail / Total---------|
MQ | 1/2 |
ORACLE | 10/10 |
TMADMIN ... (3 Replies)
Hi.. i have written a shell script and made this script to run on every day night 11: 55 pm using a cron job.
This cron job running for some days and is not running for some day. but i need this script to run every day night. Please help me.
Here is the cron tab entries,
55 23 * * *... (1 Reply)
Hi friends
I want to know can we check how many php files are running currently or can we know that a file is running or not.
Maine issue is that i am running two or three files, there are lots of code on them, each files takes 20 minutes to complete. i want to know that first file is... (7 Replies)
Hi,
I have a script which does couple of database connection and run some SELECT queries to get some output in the file.
I am surprised to see :eek: that when i run my script some times it gives the desired out put and sometimes it shows some error :confused: .
Suppose if i execute it say... (3 Replies)
Discussion started by: Sharma331
3 Replies
LEARN ABOUT HPUX
show_object
show object(1m) show object(1m)NAME
show object - Displays attribute information about the specified object entry
SYNOPSIS
cdscp show object object-name [attribute-name] [with attribute-name = attribute-value]
ARGUMENTS
The full name of a specific object entry. The last simple name can contain wildcard characters. The name of a particular attribute; see
Description for valid attribute names. The value of a particular attribute.
DESCRIPTION
The show object command displays the names and values of the attributes specified in attribute-name. You can use a combination of
attributes in a single command. Use a space to separate multiple attributes. You can use a with attribute-name = attribute-value clause to
limit output only to object entries whose attributes have values equal to the specified values. If you do not supply any attributes, the
command displays all attributes and their values. In addition to the following attributes, any application-defined attributes that might
exist will be included in the output of this command. The following is a description of object entry attributes: Specifies the class to
which an object belongs. Contains the version number of the object's class. This allows applications to build in compatibility with
entries created by earlier versions. Specifies the creation timestamp (CTS) of this object entry. Specifies a unique identifier for the
object being referenced. Specifies the timestamp of the most recent update to an attribute of the object entry.
Privilege Required
You must have read permission to the object entry. If you specify a wildcard object entry name, you also need read permission to the
directory that stores the object entry.
NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE.
EXAMPLE
The following command lists all the attributes and their values of the object entry /.:/sales/east/floor1cp. cdscp> show object
/.:/sales/east/floor1cp
SHOW
OBJECT /.../abc.com/sales/floor1cp
AT 1991-10-15-15:53:07
CDS_CTS = 1991-10-15-19:53:03.00000003/08-00-2b-1c-8f-1f
CDS_UTS = 1991-10-15-19:53:03.00000006/08-00-2b-1c-8f-1f
RELATED INFORMATION
Commands: add object(1m), create object(1m), delete object(1m), list object(1m), remove object(1m), set object(1m)
show object(1m)