Sponsored Content
Operating Systems Solaris How to capture only some part of output when command executed?? Post 302372066 by vijaysachin on Tuesday 17th of November 2009 02:55:01 AM
Old 11-17-2009
How to capture only some part of output when command executed??

Hi,

When I execute this command
prtdiag -v

output sample :
System clock frequency: 160 MHZ
Memory size: 4GB

==================================== CPUs ====================================
E$ CPU CPU
CPU Freq Size Implementation Mask Status Location
--- -------- ---------- --------------------- ----- ------ --------
0 1280 MHz 1MB SUNW,UltraSPARC-IIIi 2.4 on-line MB/P0
1 1280 MHz 1MB SUNW,UltraSPARC-IIIi 2.4 on-line MB/P1

================================= IO Devices =================================
Bus Freq Slot + Name +
Type MHz Status Path Model
------ ---- ---------- ---------------------------- --------------------
pci 66 MB pci108e,1648 (network)
okay /pci@1f,700000/network@2

pci 66 MB pci108e,1648 (network)
okay /pci@1f,700000/network


But I want only CPU count i.e 0 and 1 from above output.
How can I parse the output for only CPU column in shell script?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[csh] How to capture output from a command and pass it on to a variable?

Hi there! I'm trying to write a script that will capture output from a command and assign it to a variable. Let's say, for example, I'd like to catch from inside the script whatever the following command outputs: ls *.aaa and put it into a variable "listoffiles". What I tried was: set... (3 Replies)
Discussion started by: machinogodzilla
3 Replies

2. Shell Programming and Scripting

Set specific part in command output into variable

I am trying unsuccessfully to set into a variable a specific part of command output: The command output will be as: line 1: <varied> line 2: 2 options: option 1: Set view: ** NONE ** or option 2: Set view: <different_name_of_views_always_without_spaces> and I would like to get into... (7 Replies)
Discussion started by: orit
7 Replies

3. Shell Programming and Scripting

How do I capture multiple lines of the status output of a command?

I need to know what the upload speed of an Internet connection. I thought the easiest way to do this would be to transfer a file via FTP to my server using the command: sh-3.2$ ftp -u ftp://username:password@computerdomain/directory/ file_to_be_uploaded Note: My environment allows me to issue... (2 Replies)
Discussion started by: zzz1528
2 Replies

4. Shell Programming and Scripting

Enter the command to capture output--help

&& echo "PLEASE enter the command to capture output" || echo "Processing your command manual" x=$# echo $x while do while man $@ | read -r line do >$@.txt ... (1 Reply)
Discussion started by: rrd1986
1 Replies

5. Solaris

How to capture Output of truus command

Hi I want to check if some process is sleeping. I can see that in truss -p <pid> I want to capture output and check that output if proces sis sleeping. Please suggest way to capture output of truss command or other way to check if process is sleeping (1 Reply)
Discussion started by: ankush_mehra
1 Replies

6. Shell Programming and Scripting

Capture output of command triggered in background

Is there any way to trigger a sequence of commands in parallel and capture their output in variables? e.g. something on the following lines x=`echo "X" &` y=`echo "Y" &` z=`echo "Z" &` so that $x, $y, and $z evaluate to X, Y and Z res. (7 Replies)
Discussion started by: jawsnnn
7 Replies

7. HP-UX

How capture all user command line output?

Hi I want to know how capture all user command line output and save this commands and outputs to text files? if you have script for this subject please give me.:o please help me thank you (6 Replies)
Discussion started by: amvhd
6 Replies

8. UNIX for Dummies Questions & Answers

Set Command to output a log of every command executed in the script

Hi Guys, I like to output every command executed in the script to a file. I have tried set -x which does the same. But it is not giving the logs of the child script which is being called from my script. Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies

9. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

10. Programming

Python Paramiko multi threading to capture all output for command applied in loop

My issue : I am getting only last command output data in ouput file. Though comamnd "print(output)" displays data for all 3rd column values but the data saved in file is not what required it hs to be the same which is being printed by command"print(output)". Could you please help me to fix this,... (0 Replies)
Discussion started by: as7951
0 Replies
sysdef(1M)                                                System Administration Commands                                                sysdef(1M)

NAME
sysdef - output system definition SYNOPSIS
/usr/sbin/sysdef [-i] [-n namelist] /usr/sbin/sysdef [-h] [-d] [-i] [-D] DESCRIPTION
The sysdef utility outputs the current system definition in tabular form. It lists all hardware devices, as well as pseudo devices, system devices, loadable modules, and the values of selected kernel tunable parameters. It generates the output by analyzing the named bootable operating system file (namelist) and extracting the configuration information from it. The default system namelist is /dev/kmem. OPTIONS
-i Prints the configuration information from /dev/kmem. This is the default and only needs to be specified if the configura- tion information from both /dev/kmem and the system file specified with the "-n namelist" option is needed. -nnamelist Specifies a namelist other than the default (/dev/kmem). The namelist specified must be a valid bootable operating system. -h Prints the identifier of the current host in hexadecimal. This numeric value is unique across all Sun hosts. -d The output includes the configuration of system peripherals formatted as a device tree. -D For each system peripheral in the device tree, display the name of the device driver used to manage the peripheral. EXAMPLES
Example 1: Sample output format The following example displays the format of the sysdef -d output: example% sysdef -d Node 'SUNW,Ultra-5_10', unit #-1 Node 'packages', unit #-1 (no driver) Node 'terminal-emulator', unit #-1 (no driver) Node 'deblocker', unit #-1 (no driver) Node 'obp-tftp', unit #-1 (no driver) Node 'disk-label', unit #-1 (no driver) Node 'SUNW,builtin-drivers', unit #-1 (no driver) Node 'sun-keyboard', unit #-1 (no driver) Node 'ufs-file-system', unit #-1 (no driver) Node 'chosen', unit #-1 (no driver) Node 'openprom', unit #-1 (no driver) Node 'client-services', unit #-1 (no driver) Node 'options', unit #0 Node 'aliases', unit #-1 (no driver) Node 'memory', unit #-1 (no driver) Node 'virtual-memory', unit #-1 (no driver) Node 'pci', unit #0 Node 'pci', unit #0 Node 'ebus', unit #0 Node 'auxio', unit #-1 (no driver) Node 'power', unit #0 Node 'SUNW,pll', unit #-1 (no driver) Node 'se', unit #0 (no driver) Node 'su', unit #0 Node 'su', unit #1 Node 'ecpp', unit #-1 (no driver) Node 'fdthree', unit #0 Node 'eeprom', unit #-1 (no driver) Node 'flashprom', unit #-1 (no driver) Node 'SUNW,CS4231', unit #0 (no driver) Node 'network', unit #0 Node 'SUNW,m64B', unit #0 Node 'ide', unit #0 Node 'disk', unit #-1 (no driver) Node 'cdrom', unit #-1 (no driver) Node 'sd', unit #1 Node 'dad', unit #1 Node 'pci', unit #-1 (no driver) Node 'SUNW,UltraSPARC-IIi', unit #-1 (no driver) Node 'pseudo', unit #0 [output truncated] FILES
/dev/kmem default operating system image ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
hostid(1), prtconf(1M), nlist(3ELF), attributes(5) SunOS 5.10 4 Oct 2004 sysdef(1M)
All times are GMT -4. The time now is 10:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy