Sponsored Content
Top Forums Shell Programming and Scripting Perl parsing compared to Ksh parsing Post 302222442 by Annihilannic on Wednesday 6th of August 2008 10:46:42 PM
Old 08-06-2008
Something like this?

Code:
if ($syst =~ /Version ([^,]+),/) { $version=$1; } else { $version="unknown"; }
if ($syst =~ /sysName.*STRING: (.+)/) { $hnam=$1; } else { $hnam="unknown"; }
print "$version\n$hnam\n";

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

HTML parsing by PERL

i have a HTML report file..its in attachment(a part of the whole report is attached..name "input html.doc").also its source is attached in "report source code.txt" i just want to seperate the datas like in first line it should be.. NHTEST-3848498958-NHTEST-10.2-no-baloo a and so on for whole... (3 Replies)
Discussion started by: avik1983
3 Replies

2. Shell Programming and Scripting

Parsing and getting data from XML file using ksh script

Hi All, I have a xml file for example as described below <xml> <address> <street><street> <address/> <isbn>426728783932020308393930303</isbn> <book> <name> </name> </book> . . . </xml> My problem is to get the isbn number from the above described file using ksh script. Could... (6 Replies)
Discussion started by: vinna
6 Replies

3. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

4. Shell Programming and Scripting

Perl Parsing Argument

i wanna passing an argument which read in a file or a set of files if the files are given in the command line, otherwise use STDIN if no file argument. i got something like that, but it is not really working. so can anyone help me? which one is better to use for and how? Use perl. Thank you ... (0 Replies)
Discussion started by: mingming88
0 Replies

5. Shell Programming and Scripting

help with ksh parsing traceroute output

Good day. I am doing an enq -WA (AIX), to get a list of the print queues, I then compare that to the /etc/hosts file to 'match' the IP address associated with the print queues. What I want to do is to run a traceroute with up to 5 hops, and perform an output to a file with some "specific items".... (0 Replies)
Discussion started by: smurphy_it
0 Replies

6. Shell Programming and Scripting

Need help parsing config file in ksh

Hi all, I've done some searching here but haven't found exactly what I'm looking for so I thought I'd post up and see if someone can help out. I'm working on a shell script that I would like to store environment variables in an external file. I'm familiar with sourcing a file with variables in... (1 Reply)
Discussion started by: kungfusnwbrdr
1 Replies

7. Shell Programming and Scripting

XML parsing in KSH

Hi All, Although I was able to find past XML parsing questions, as the questions were a little different than this, I had a pretty hard time adapting those answers to this scenario. -> May I ask if anyone knows how to extract the IP addresses of the below "servers.xml" file into an array... (5 Replies)
Discussion started by: chatguy
5 Replies

8. UNIX for Advanced & Expert Users

Perl parsing help required.

Hello, I got a file like this. 5201 5202 5203 5204 1234 2345 3456 4567 6210 6220 6230 6240 The required output should be 5201 1234 6210 (9 Replies)
Discussion started by: suverman
9 Replies

9. Shell Programming and Scripting

Parsing ksh script

Is there any tool that can parsing ksh script into grammar format? e.g. the tool can parse the following ksh script: echo "hello"> abc.txt cp /home/user/abc/.profile /home/user/abc/myprofile into GENERATE abc.txt COPY /home/user/abc/.profile TO /home/user/abc/myprofile My server OS... (2 Replies)
Discussion started by: cstsang
2 Replies

10. Shell Programming and Scripting

ksh parsing arguments in a string rather than from the cmdln

Hi. I have a piece of code that reads and parses command line options. I'd like to alter it slightly to read from a string (that's set elsewhere in the script) rather than directly from the command line (arg). Can somebody show me how to do this? Many thanks. My code is as follows: typeset... (6 Replies)
Discussion started by: user052009
6 Replies
UNAME(1)							   User Commands							  UNAME(1)

NAME
uname - print system information SYNOPSIS
uname [OPTION]... DESCRIPTION
Print certain system information. With no OPTION, same as -s. -a, --all print all information, in the following order, except omit -p and -i if unknown: -s, --kernel-name print the kernel name -n, --nodename print the network node hostname -r, --kernel-release print the kernel release -v, --kernel-version print the kernel version -m, --machine print the machine hardware name -p, --processor print the processor type or "unknown" -i, --hardware-platform print the hardware platform or "unknown" -o, --operating-system print the operating system --help display this help and exit --version output version information and exit AUTHOR
Written by David MacKenzie. REPORTING BUGS
Report uname bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> Report uname translation bugs to <http://translationproject.org/team/> COPYRIGHT
Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
arch(1), uname(2) The full documentation for uname is maintained as a Texinfo manual. If the info and uname programs are properly installed at your site, the command info coreutils 'uname invocation' should give you access to the complete manual. GNU coreutils 8.5 February 2011 UNAME(1)
All times are GMT -4. The time now is 08:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy