Sponsored Content
Top Forums Shell Programming and Scripting Finding a "word" through grep but display line above? Post 302455742 by Stephan on Wednesday 22nd of September 2010 10:34:19 AM
Old 09-22-2010
Hi.
Yep, the "status" line finishes at the dot...

Ok, if i issue your command...I get all processes runnning including the "Waiting" ones...

q proc | grep -e "Process Number" -e Waiting
Process Number: 25,823
Process Number: 32,660
Process Number: 32,706
Process Number: 32,901
Status: Volume 701827 (storage pool TAPEUNIX_DB), Moved Files: 0, Moved Bytes: 0, Unreadable Files: 0, Unreadable Bytes: 0. Current Physical File (bytes): 282,139,213 Waiting for mount of input volume 701827 (456 seconds). Current output volume: 210214L4.
Process Number: 32,902
Status: Volume 700740 (storage pool TAPEUNIX_DB), Moved Files: 0, Moved Bytes: 0, Unreadable Files: 0, Unreadable Bytes: 0. Current Physical File (bytes): 62,175,904,037 Waiting for mount of input volume 700740 (456 seconds). Current output volume: 210318L4.

What if i only wanted the processes that contain the "status" waiting?

Thanks again.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep/cat/more -- search in a txt file and display content from a specific "keyword"

Hi, I have a .txt file Sample: ===================== NEXT HOST ===================== AEADBAS001 ip access-list extended BLA_Incoming_Filter ip access-list extended BLA_Outgoing_Filter access-list 1 permit xxxxxxxxxxxxxx access-list 2 permit xxxxxxxxxxxxxx =====================... (4 Replies)
Discussion started by: I-1
4 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. Shell Programming and Scripting

cat/delete per line any word "192.168.1.12"

Hi All Can u help me.. My problem is delete word per line sample: cat /tmp/file.txt monitor 192.168.1.11 Copying files in current directory 1 monitor 192.168.1.1 Copying files in current directory 2 monitor 192.168.1.12 Copying files in current directory 3 monitor 192.168.1.14... (1 Reply)
Discussion started by: carnegiex
1 Replies

4. UNIX for Dummies Questions & Answers

Display all the lines that contain "Straw" followed somewhere in the line by Hat?

how do i use this in a grep pattern, the output is inventory (3 Replies)
Discussion started by: 3dd1e
3 Replies

5. Shell Programming and Scripting

ps -ef | grep "string1" "string2" " "string3"

Hi all, can any one suggest me the script to grep multiple strings from ps -ef pls correct the below script . its not working/ i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK. bash-3.00$ ps -ef | grep blu lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

8. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies

9. Shell Programming and Scripting

Add the word "prefix" to beginning of line using sed

SUSE linux bash shell this works test -d /tmpp && echo "directory exists" || echo "directory doesn't exists" |sed -e "s/^/prefix /" prefix directory doesn't exists but why doesn't this work? test -d /tmp && echo "directory exists" || echo "directory doesn't exists" |sed -e... (3 Replies)
Discussion started by: snoman1
3 Replies

10. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
lvdisplay(1M)															     lvdisplay(1M)

NAME
lvdisplay - display information about LVM logical volumes SYNOPSIS
lv_path ... Remarks If the logical volume input arguments belong to a combination of volume groups versions 1.0 and 2.0 or higher, the arguments may not be processed in the order they are listed on the command line. Mirrored disk information requires the installation of the optional HP MirrorDisk/UX software, which is not included in the standard HP-UX operating system. DESCRIPTION
The command displays the characteristics and status of each logical volume specified by lv_path. Options and Arguments recognizes the following options and arguments: lv_path The block device path name of a logical volume, for example, Produce a compact listing of fields described in The output is a list of colon separated fields formatted as value...]. For each logical volume, display the physical volume distribution, and the mapping of the logical extents onto the physical extents of the physical volumes. This option displays the same information as the option, except in the column where is displayed, the (Physical Volume Number in VG) will be displayed instead. Use this option with the option. Display Without -v Option If you omit the option, displays the following information for each logical volume: The block device path name of the logical volume. The path name of the volume group. The access permission and quiesce mode: The access permission is either: or If the VG containing the LV is quiesced, the quiesce mode is displayed on the same line. The quiesce mode is either: or State of the logical volume: Available but contains physical extents that are not current. Available with no stale extents. Not available for use. Number of mirror copies. Mode of mirror consistency recovery which determines how LVM performs mirror consistency recovery during volume group activation: Recover mirror consistency by using the Mirror Write Cache and Mirror Consistency Record. Implies that Mirror Write Cache is on. Recover mirror consistency by going through all logical extents and copying data from a non-stale copy to the other mirror copies. Implies that Mirror Write Cache is off. No mirror consistency recovery during volume group activation on this logical volume following a system crash. The user of the logical volume is responsible for ensuring mirror consistency. Implies that Mirror Write Cache is off. Striped, sequential or parallel scheduling policy. Striped policy is by default parallel scheduling for mirrored I/O. Size of the logical volume in megabytes (MB). Number of logical extents currently in the logical volume. Number of physical extents allocated to the logical volume. The number of stripes. If this field is 0, then the logical volume is not striped. The size of each stripe in kilobytes (KB). Bad block relocation policy. Current allocation state, displayed as one of: Physical extents are allocated in an ascending order without any gap between adjacent extents. All physical extents of a given mirror are contained in a single physical volume. Distributed allocation is turned on and any two consecutive logical extents are guaranteed to be located on different physical volumes. See lvcreate(1M) for more information. Distributed allocation is turned on but any two consecutive logical extents are NOT guaranteed to be located on different physical volumes. See lvchange(1M) for more information. Physical extents that belong to the same logical extent can be allocated on the same physical volume or physical volume group. Mirror copies for a logical extent are not allocated on the same physical volume group. Mirror copies for a logical extent are not allocated on the same physical volume. The IO timeout used by LVM for all IO to this logical volume. A value of default, indicates that the system will use the value of "forever". (Note: the actual duration of a request may exceed this timeout value when the underlying physical volume(s) have timeouts which either exceed this value or are not integer multiples thereof.) Display With -v Option If you specify the option, also lists the distribution of each logical volume across the physical volumes of the volume group and the map- ping of each logical extent of the logical volume on the physical extents of the physical volume. The distribution of logical volume lv_path across the physical volumes of the volume group, displayed in the following columns: The block device path name of the physical volume where the logical extents are allocated. The Physical Volume Number in VG (if option is specified). Number of logical extents allocated on the physical volume. Number of physical extents allocated on the physical volume. The mapping of logical extents onto physical extents, displayed in the following columns: Logical extent number. The block device path name of the physical volume that corresponds to the location of the first physical extent of the logical extent. First physical extent number allocated to the logical extent. Status of the first physical extent: or The following columns are displayed if there is at least one mirror copy: The block device path name of the physical volume that corresponds to the location of the second physical extent (first copy) of the logical extent. Second physical extent number allocated to the logical extent. Status of the second physical extent: or The following columns are displayed if there are at least two mirror copies: The block device path name of the physical volume that corresponds to the location of the third physical extent (second copy) of the logical extent. Third physical extent number allocated to the logical extent. Status of the third physical extent: or If there are more than 3 physical extents associated with one logical extent (applicable for logical volumes created within volume groups versions 2.0 or higher only), then a second line of physical extent(s) is displayed for the logical extent. The rest of the line contains the following columns: The following columns are displayed if there are at least three mirror copies: Logical extent number. The block device path name of the physical volume that corresponds to the location of the fourth physical extent(third copy) of the logical extent. Fourth physical extent number allocated to the logical extent. Status of the fourth physical extent: or The following columns are displayed if there are at least four mirror copies: The block device path name of the physical volume that corresponds to the location of the fifth physical extent (fourth copy) of the logical extent. Fifth physical extent number allocated to the logical extent. Status of the fifth physical extent: or The following columns are displayed if there are five mirror copies: The block device path name of the physical volume that corresponds to the location of the sixth physical extent(fifth copy)of the logical extent. Sixth physical extent number allocated to the logical extent. Status of the sixth physical extent: or Compact Listing (-F Option) The option generates a compact and parsable listing of the command output in colon separated fields formatted as value...]. The option is designed to be used by scripts. The resulting command output may be split across multiple lines. The output may include new keys and/or values in the future. If a key is deprecated, its associated value is set to For the current version of the command, the lines format is: The format of Line 1 is as follows: lv_name=value:vg_name=value:lv_permission=value:lv_status=value: mirror_copies=value:consistency_recovery=value:schedule=value: lv_size=value:current_le=value:allocated_pe=value:stripes=value: stripe_size=value:bad_block=value:allocation=value:used_pv=value: io_timeout=value The format of Line 2 is as follows: pv_name=value:le_on_pv=value:pe_on_pv=value The above line may be repeated with different values. The format of Line n is as follows: le=value:pv1=value:pe1=value:status_1=value[:...:pvN=value:peN=value: status_N=value] The above line may be repeated with different values. EXTERNAL INFLUENCES
Environment Variables determines the language in which messages are displayed. If is not specified or is null, it defaults to "C" (see lang(5)). If any internationalization variable contains an invalid setting, all internationalization variables default to "C" (see environ(5)). EXAMPLES
Display information about a logical volume: Display all the available information about a logical volume, including the characteristics, status and distribution map: Display all the available information about a logical volume, but display instead of in the status and distribution map. SEE ALSO
lvchange(1M), lvcreate(1M), lvextend(1M), lvmadm(1M), lvreduce(1M), lvm(7), pvdisplay(1M), vgdisplay(1M). lvdisplay(1M)
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy