Sponsored Content
Top Forums Shell Programming and Scripting need a little help with results from awk Post 302246211 by draco on Monday 13th of October 2008 05:03:43 AM
Old 10-13-2008
need a little help with results from awk

Hi there all,

I am using a line to get some replys from my PS
I do
ps -ef |awk '{printf $9}'
But my result is 1 big line.
No spaces between the lines or someting

for example:
Code:
ress/dlc91d/bin/_mprosrv/zam/progress/dlc91d/bin/_mprosrvoraclexfwaora_lgwr_xfwtextprocxmcare_extproc9it/zam/progress/dlc91d/bin/_mprosrv/glims/progress/dlc91e/bin/_mprosrv/zam/progress/dlc91d/bin/_progresoraclexfwa/usr/dt/bin/rpc.ttdbserverextprocxmcare_extproc9ia/glims/progress/dlc91e/bin/_mprshut/zam/progress/dlc91d/bin/_mprosrv/zam/progress/dlc91d/bin/_progres/zam/progress/dlc91d/bin/_mprosrv<defunct>ora_mmnl_xmct(LOCAL=NO)oraclexcfa/glims/progress/dlc91e/bin/_mprshut/zam/progress/dlc91d/bin/_mprosrv../../bin/wrapperora_q000_xfwt/glims/progress/dlc91e/bin/_mprshutoraclexcft/glims/progress/dlc91e/bin/_mprosrvora_q001_xcft/opt/omni/lbin/rds/opt/java1.4/bin/PA_RISC2.0/javaoraclexfwt../../bin/wrapper/glims/progress/dlc91e/bin/_mprosrvora_qmnc_xmct/zam/progress/dlc91d/bin/_sqlsrv2ora_mman_xcft-m1/glims/glims/glims7prd/bin/hl7ora_pmon_xcft/xct/appl/oracle/product/10.2/bin/tnslsnroraclexfwt/zam/zamicom/hl7/hl7drvr2/zam/progress/dlc91d/bin/_sqlsrv2ora_qmnc_xfwtora_psp0_xmct/glims/progress/dlc91e/bin/_mprosrvora_q001_xfwtoraclexfwt/glims/progress/dlc91e/bin/_mprosrvora_ckpt_xfwt/zam/progress/dlc91d/bin/_progres/glims/progress/dlc91e/bin/_mprosrv/glims/progress/dlc91e/bin/_mprosrv/dp/appl/oracle/product/9.2.0/bin/tnslsnr/glims/progress/dlc91e/bin/_mprosrvora_mmnl_xfwtora_ckpt_xcft/sbin/shora_dbw0_xfwt/glims/progress/dlc91e/bin/_mprshutoraclexcfaextprocxmcare_extproc9it/opt/java1.4/bin/PA_RISC2.0/javaextprocxmcare_extproc9itlvmattachdoraclexfwa/glims/progress/dlc91e/bin/_mprosrv/opt/java1.4/jre/bin/PA_RISC2.0/javaoraclexfwtoraclexmcaora_psp0_xcftora_smon_xmct/sbin/sh/glims/progress/dlc91e/bin/_mprosrv/glims/progress/dlc91e/bin/_mprosrvora_mman_xmct-m1ora_dbw0_xmct/glims/progress/dlc91e/bin/_mprosrv/glims/progress/dlc91e/bin/_mprshut/glims/progress/dlc91e/bin/_mprshut/glims/progress/dlc91e/bin/_mprosrv/glims/progress/dlc91e/bin/_mprosrvoraclexmct/glims/progress/dlc91e/bin/_mprosrv/glims/glims/glims7prd/bin/_progres/glims/progress/dlc91e/bin/_mprosrv/glims/prog

How can i get it that all get spaces between them?
So I can make some kind of monitorring system?
I want the results in an array.. Smilie

Thanx !
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk | stop after specified number of results

I am searching some rather large text files using grep and or awk. What I would like to know is if there is a way (either with grep, awk, or realy any other unix tool) to stop the search when a predifined number of results are returned. I would like to do this for speed purpuses. When i get... (6 Replies)
Discussion started by: evan108
6 Replies

2. Shell Programming and Scripting

Specific Length awk Results

I am awk-ing a line, and only want to get the results of the five chrs. following my field seperator. the line of prose is: Unit=01982 (PICO RIVERA) Unit=I1001 (INTERMOUNTAIN AREA) Unit=E1000 (INTERMOUNTAIN WEST DIVISION) failing in using an awk of: awk -F= '/Unit/{print $2 length(5)}'... (3 Replies)
Discussion started by: gozer13
3 Replies

3. Shell Programming and Scripting

store awk results in a variable

I try to get the month (of last save) and the filename into a variable, is this possible ? something like this : for month in `ls -la | awk '{print $6}'` do if ] then a=filename of the matching file cp $a /Sep fi thanks, Steffen (1 Reply)
Discussion started by: forever_49ers
1 Replies

4. Shell Programming and Scripting

Wierd results with awk

Hey, I'm trying to use awk for some simple file manipulations but i'm getting soem wierd results. So i want to open up a file which looks like this: @relation 'autoMpg' @attribute a numeric @attribute b numeric @attribute c numeric @data -1.170815,0.257522,0.016416... (2 Replies)
Discussion started by: amatheny
2 Replies

5. Shell Programming and Scripting

AWK - no search results

Hi all, I'm new to awk and I'm experiencing syntax error that I don't know how to resolve. Hopefully some experts in this forum can help me out. I created an awk file that look like this: $ cat myawk.awk BEGIN { VAR1=PATTERN1 VAR2=PATTERN2 } /VAR1/ { flag=1 } /VAR2/ { flag=0 } {... (7 Replies)
Discussion started by: hk18
7 Replies

6. Shell Programming and Scripting

Output of AWK Results

In the following line The AWK statement parses through a listing for files and outputs the results using the {print} command to the screen. Is there a way to (a) send the output to a file and (b) actually perform a cp cmd to copy the listed files to another directory? ls | awk -va=$a -vb=$b... (1 Reply)
Discussion started by: rdburg
1 Replies

7. Shell Programming and Scripting

Loop through awk results

I have files structured in stanzas, whose title is '', and the rest couples of 'id: value'. I need to find text within the title and return the whole stanzas that match the title. The following works: awk 'BEGIN{RS="";IGNORECASE=1}/^\/' myfileI would need to count all of the occurences, though,... (7 Replies)
Discussion started by: hermes14
7 Replies

8. Shell Programming and Scripting

Substitute from awk results

Hi, The following awk command : asmcmd lsdg | awk '{print $13;}' | grep -i ${SID} return the following output . An Empty line + two lines contain "/" at the end of the line INDEVDATA/ INDEVFRA/ I need to remove the "/" as well as the empty line. Please advise Thanks (3 Replies)
Discussion started by: Yoav
3 Replies

9. Shell Programming and Scripting

Removing certain lines from results - awk

im using the code below to monitor a file: gawk '{ a += gsub("(^| )accepted( |$)", "&") a += gsub("(^| )open database( |$)", "&") } END { for (i in a) printf("%s=%s\n", i, a) }' /var/log/syslog the code is searching the syslog file for the string "accepted" and "open... (2 Replies)
Discussion started by: SkySmart
2 Replies

10. Shell Programming and Scripting

awk parse snmp results

i run the command snmptable -v2c -c public myIP IF-MIB::ifTable the result look like this : SNMP table: IF-MIB::ifTable ifIndex ifDescr ifType ifMtu ifSpeed ifPhysAddress ifAdminStatus ifOperStatus 1 Unit: 1 Slot: 0 Port: 1... (7 Replies)
Discussion started by: wanttolearn1
7 Replies
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/ksh93 /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/ksh93 /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/sfw/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. NOTES
Restricted shells should not be listed in /etc/shells. SunOS 5.11 1 Nov 2007 getusershell(3C)
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy