Sponsored Content
Full Discussion: output required
Top Forums Shell Programming and Scripting output required Post 302312230 by Franklin52 on Thursday 30th of April 2009 05:12:14 PM
Old 04-30-2009
Assuming the pattern is always before the field between the parentheses:

Code:
sed 's/.* \(.*\) (.*/\1/' file


Last edited by Franklin52; 04-30-2009 at 06:18 PM.. Reason: literal correction
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help me how to use nawk for required output

Hi all i have 2 input files 1st file is N1 | N2|N3|N4|N5|N6|N7|N8|N9 4041491000|245160|1|0|0|1|0|0|0 4041401505|152178|1|1|1|1|0|0|0 4041450004|014052|1|1|1|1|0|0|0 4041450005|580916|1|1|1|1|0|0|0 4041491000|230990|1|0|1|1|0|0|0 4041460001|338317|1|1|1|1|0|0|0 2nd file N1 |... (8 Replies)
Discussion started by: dodasajan
8 Replies

2. Shell Programming and Scripting

perl required output

Hi, I have a string in log file from that i need to pick the username. the string is like this-- pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid... (5 Replies)
Discussion started by: namishtiwari
5 Replies

3. Shell Programming and Scripting

Help required on grep command(Skip the first few lines from printing in the output)

Hi experts I want the proper argument to the grep command so that I need to skip the first few lines(say first 10 lines) and print all the remaining instances of the grep output. I tried to use grep -m 10 "search text" file*. But this gives the first 10 instances(lines) of the search string.... (7 Replies)
Discussion started by: ks_reddy
7 Replies

4. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

5. Shell Programming and Scripting

Script to get required output from textfile

Hi Iam running below script on one text file. usr/xpg4/bin/awk 'BEGIN {print "IP HOST_NAME SUB "} /IP IS/ {IP=$3} /local/ {HOST=$1} /PPPoE/ {SUB=$3 ;print IP, HOST, SUB} ' /Scripts/sub_report_$FILE>/Scripts/sub_final_report_.txt the output is coming as below IPHOST_NAME SUB ... (16 Replies)
Discussion started by: surender reddy
16 Replies

6. Shell Programming and Scripting

Problem getting the required output

I need a Korn shell script which does the folllowing:- If there is one "|" (pipe) delimited file so, the script should check the 5th field to be blank or not. if it is a blank tht entire line of the file should be redirected to another file. if the 5th field is not blank it should pass that. ... (4 Replies)
Discussion started by: Juhi Kashyap
4 Replies

7. Shell Programming and Scripting

Formatting required with the output

i have a o/p from find command that needs to be formatted currently when i'm running find . -name "v.info" it is giving below o/p /o/a/b/c/v.info /o/a/b/c/d/v.info /o/aa/bb/cc/v.info /o/aa/bb/cc/dd/v.info my requirement is if v.info is coming under sub-directories it shul be... (15 Replies)
Discussion started by: nikhil jain
15 Replies

8. SuSE

Find command doesn't pipe the output as required.

Hi, I am using below code snippet to echo/display the files found (matching a pattern from searchstring.out file) and the corresponding owner. while read j do echo "Pattern to search is:- $j" find / -name "*$j*" |\ while read k do echo "File found is:- $k" owner=$(ls... (9 Replies)
Discussion started by: Vipin Batra
9 Replies

9. Shell Programming and Scripting

Required formatted output on mail for disk utilization

Hi Experts, Could you pls help with below query I have written below script to capture disk utilization and then send the output on mail. But getting unformated output on mail #!/bin/bash echo "Hi Sur,">dfoutput.csv printf '\n' >>dfoutput.csv echo "Please find BAYSQUAR2 filesystem... (4 Replies)
Discussion started by: as7951
4 Replies

10. UNIX for Beginners Questions & Answers

Required column output should be arranged in awk

dump file 2020-01-05 & 234135 ossuser 4 CACLP; 2020-01-05 & 234207 ossuser 3 CACLP; 2020-01-05 & 234307 ossuser 1002 CACLP; 2020-01-05 & 234427 ossuser 0 CACLP; 2020-01-05 & 234429 ossuser 1 CACLP; Command used awk ... (1 Reply)
Discussion started by: Sagar Singh
1 Replies
HOSTNAMEUTILS(1)					   Sun Grid Engine User Commands					  HOSTNAMEUTILS(1)

NAME
sge_hostnameutils.1 - SGE Host name utilities gethostname - get local hostname. gethostbyname - get local host information for specified hostname. gethostbyaddr - get hostname via IP address. getservbyname - get configured port number of service SYNTAX
gethostname [-help|-name|-aname|-all] gethostbyname [-help|-name|-aname|-all] <name> gethostbyaddr [-help|-name|-aname|-all] <ip> getservbyname [-help|-number] <service> DESCRIPTION
gethostname and gethostbyname are used to get the local resolved host name. gethostbyaddr is used to get the hostname of a specified IP address (dotted decimal notation). getservbyname can be used to get the configured port number of a service (e.g. from /etc/services). The hostname utils are primarily used by the Sun Grid Engine installation scripts. gethostname , gethostbyname and gethostbyaddr called without any option will print out the hostname, all specified aliases, and the IP address of the locally resolved hostname. Calling get- servbyname without any option will print out the full service entry. OPTIONS
-help Prints a list of all options. -name This option only reports the primary name of the host. -aname If this option is set, the Sun Grid Engine host alias file is used for host name resolving. It is necessary to set the environment variable SGE_ROOT and, if more than one cell is defined, also SGE_CELL. This option will print out the Sun Grid Engine host name. -all By using the -all option all available host information will be printed. This information includes the host name, the Sun Grid Engine host name, all host aliases, and the IP address of the host. -number This option will print out the port number of the specified service name. <name> The host name for which the information is requested. <ip> The IP address (dotted decimal notation) for which the information is requested. <service> The service name for which the information is requested (e.g. ftp, sge_qmaster or sge_execd). EXAMPLES
The following example shows how to get the port number of the FTP service: >getservbyname -number ftp 21 The next example shows the output of gethostname -all when the host alias file contains this line: gridmaster extern_name extern_name.mydomain The local host resolving must also provide the alias name "gridmaster". Each Sun Grid Engine host that wants to use the cluster must be able to resolve the host name "gridmaster". To setup an alias name, edit your /etc/hosts file or modify your NIS setup to provide the alias for the NIS clients. The host alias file must be readable from each host (use e.g. NFS shared file location). >gethostname -all Hostname: extern_name.mydomain SGE name: gridmaster Aliases: loghost gridmaster Host Address(es): 192.168.143.99 ENVIRONMENTAL VARIABLES
SGE_ROOT Specifies the location of the Sun Grid Engine standard configuration files. SGE_CELL If set, specifies the default Sun Grid Engine cell. SEE ALSO
sge_intro(1), host_aliases(5), COPYRIGHT
See sge_intro(1) for a full statement of rights and permissions. SGE 6.2u5 $Date$ HOSTNAMEUTILS(1)
All times are GMT -4. The time now is 04:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy