Help with documentation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with documentation
# 1  
Old 04-29-2011
Help with documentation

I have a list of file names

Code:
Set Lst = "n02-z30-3x2drw-run1.log n02-z30-3x2drw-run2.log n02-z30-3x2drw-run3.log n02-z50-3x2drw-run1.log n02-z50-3x2drw-run2.log"

So basically I have the files below

Code:
n02-z30-3x2drw-run1.log
n02-z30-3x2drw-run2.log
n02-z30-3x2drw-run3.log

Code:
n02-z50-3x2drw-run1.log
n02-z50-3x2drw-run2.log

Each file represents the log file produced by a program called tdarwin. It may happen that one stops the program or the program exits. You can continue running the program from where you had left off and the log file will have appended run1, run2 etc.

Thus

Code:
n02-z30-3x2drw-run1.log
n02-z30-3x2drw-run2.log
n02-z30-3x2drw-run3.log

means that the program was run 3 times using the same data and continued three times.

I actually can get the information from all three runs and generate one file with all the relevant information. So basically I get the description of the test as "n02-z30-3x2drw".

So in this case, I have actually run two test cases

Code:
n02-z30-3x2drw

and 

n02-z50-3x2drw

I want to describe that from the list

Code:
Lst = 
n02-z30-3x2drw-run1.log
n02-z30-3x2drw-run2.log
n02-z30-3x2drw-run3.log
n02-z50-3x2drw-run1.log
 n02-z50-3x2drw-run2.log

I get

Code:
Progs = 
n02-z30-3x2drw
 n02-z50-3x2drw

# 2  
Old 04-29-2011
Code:
#!/bin/ksh

Lst='n02-z30-3x2drw-run1.log n02-z30-3x2drw-run2.log n02-z30-3x2drw-run3.log n02-z50-3x2drw-run1.log n02-z50-3x2drw-run2.log'

echo $Lst | nawk '{match($0,".*-");a[substr($0,1,RSTART+RLENGTH)]}END {for(i in a) print i}' RS=' '

# 3  
Old 05-02-2011
Code:
Lst='n02-z30-3x2drw-run1.log n02-z30-3x2drw-run2.log n02-z30-3x2drw-run3.log n02-z50-3x2drw-run1.log n02-z50-3x2drw-run2.log'
echo $Lst | awk '/run1.log/{sub("-run1.log","");print}' RS=' '

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. HP-UX

Need HP unix documentation for beginner

Hello All, I am working in HP unix since 5 years on application and support. But in order to get opportunity out side i need to learn admintration Can somebody help me to guide hot start for this. Do we have any doc(pdf) to start with. Thanks Krsnadasa (1 Reply)
Discussion started by: krsnadasa
1 Replies

2. HP-UX

HP-UX 10.20 Documentation

I'm trying to find the 10.20 documentation online. I found some stuff at g4u0420c.houston.hp.com but these are pretty poor scans some of them being almost unreadable - for example: http://g4u0420c.houston.hp.com/en/B1171-90076/B1171-90076.pdf which is a scan of a DRAFT version of the X... (9 Replies)
Discussion started by: perdrix
9 Replies

3. Programming

libxml2 documentation

i need to read/write a xml file in c i found libxml2, but the documentation is awfull, im using google but i get most of vb, or c# results can anyone point me to a introduction tutorial? actually, any kind of documentation would be ok (just not the oficial The XML C parser and toolkit... (2 Replies)
Discussion started by: broli
2 Replies

4. Solaris

need LDAP documentation

Dear Members, 1- i need good documentation for LDAP installation, configuration 2- you recommeddation using LDAP under linux or solaris which is more easy for administration 3- is that possible to make integration between and LDAP and any email server like qmail (like windows active directory... (3 Replies)
Discussion started by: hosney00ux
3 Replies

5. Solaris

Help with SunOS 5.8 documentation ?

Hi all. I have machine with SUN OS 5.8 but i don't have any documentation about that. where i can found any documentation about this OS? I have look in the sticky thread about Solaris in this forum, but can't found for the SUN OS 5.8. it's same with Solaris 10 or have major difference with... (4 Replies)
Discussion started by: urangkayo
4 Replies

6. UNIX for Advanced & Expert Users

xargs documentation or tutorial?

Can anybody please forward me a good xargs documentation or tutorial? - $nilesh (5 Replies)
Discussion started by: ynilesh
5 Replies

7. UNIX for Advanced & Expert Users

df command documentation

how can i find a comprehensive documentation about df command of unix? (more detailed than unix man pages) (2 Replies)
Discussion started by: gfhgfnhhn
2 Replies

8. Programming

AIX 3.2.5 Documentation

I'm looking for books or online documentation for writing device drivers for AIX 3.2.5. I've searched IBM's website and google and come up with next to nothing. There is plenty of information for 4.1 and above but virtually nothing for 3.2.5. I'm specifically interested in porting one of the... (2 Replies)
Discussion started by: cejoe
2 Replies
Login or Register to Ask a Question