Sponsored Content
Full Discussion: Custom Report
Top Forums Shell Programming and Scripting Custom Report Post 303003267 by rdrtx1 on Monday 11th of September 2017 12:00:01 PM
Old 09-11-2017
Code:
awk '
/:.*:/ {job=$2; jobs[$2]=$2; job_type=$3; sub(" *: *", "", job_type); cols[job_type]=job_type; data[job, job_type]=$NF; next}
/:/ {match($0, " *: *"); col=substr($0, 1, RSTART-1); val=substr($0, RSTART + RLENGTH); cols[col]=col; data[job, col]=val}
END {
   printf "JOB_NAME;JOB_TYPE;";
   for (j in cols) if (j !~ /^job_type$/) printf cols[j] ";";
   print "";
   for (i in jobs) {
      printf i ";" data[i, "job_type"] ";";
      for (j in cols) {
         if (j !~ /^job_type$/) printf (length(data[i, j]) ? data[i, j] : " ") ";";
      }
      print "";
   }
}
' infile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to custom application name in `ps -ef`?

A program named /usr/bin/aa.sh, two parameters: 11, 22. after start it, the row in `ps -ef` is almost like the following: root 12198 10278 0.0 Nov 25 pts/3 0:00.23 /usr/bin/aa.sh 11 22 but I want to change "/usr/bin/aa.sh 11 22" to one rule string, such as: "AA_11_22", how to... (1 Reply)
Discussion started by: linkjack
1 Replies

2. Shell Programming and Scripting

Custom PS command

(0 Replies)
Discussion started by: goldfish
0 Replies

3. Shell Programming and Scripting

Custom auto-complete

Hello: I am using csh, and am a complete noob when it comes to shell scripting. I want the following: 1) Ignore case when doing auto-complete. 2) If there are multiple matches (example: I have files abc.txt abc.txt.1, abc.txt.2 and type abc<tab>), count the number of matches. If... (1 Reply)
Discussion started by: madiyaan
1 Replies

4. UNIX for Dummies Questions & Answers

Changing ip in a custom way

Hi. I hope someone can help me. I have e very special question. I have a Lunix server and I have installed Webmin on it. This way, I can create a login for an other user and give him restricted access to some custom commands I set up. One of the commands i would like to setup, is for him to... (9 Replies)
Discussion started by: Wonderke
9 Replies

5. AIX

Custom libraries possible on AIX 4.2 ?

I had started writting my own custom libraries on an AIX 4.2. Before finishing, I wanted to do a very simple test. So I wrote the followings: test.sh #!/bin/ksh . testlib.sh ZZ=testz "aa" "bb" echo "$ZZ" exit 0 testlib.sh testz () { return "$1$2" } When I ran my test.sh, I got an... (2 Replies)
Discussion started by: Browser_ice
2 Replies

6. Shell Programming and Scripting

doing own custom parameters

I have an rsync command that I want to create a variable where user can change to customize the parameters. complete rsync command to run: $RSYNC -e 'ssh -ax -o ClearAllForwardings=yes' --log-file=$LOG_FILE --delete -avzcr -u --update $SRC_DIR $USER@$TRG_SRV:$TRG_DIR >> $LOG_FILE What I... (4 Replies)
Discussion started by: abubin
4 Replies

7. Shell Programming and Scripting

custom command

hi I am trying to make my own commands in my linux.I thought a command for changing directories will be easy. I made a simple file amd made the entries #!/bin/bash cd /opt/mydir I then made the file executable and then moved it to /usr/bin. But when i type the script name nothing... (2 Replies)
Discussion started by: born
2 Replies

8. AIX

NPIV custom WWN

Hi All :) i would like to know if i can customize the WWN of the new VFC (NPIV). Or, if i must move the LPAR on another server with another FCS, i have to change the zoning?? Thanks in advance. Mario ---------- Post updated 09-21-12 at 02:51 AM ---------- Previous update was 09-20-12 at... (1 Reply)
Discussion started by: Zio Bill
1 Replies

9. Shell Programming and Scripting

Custom Shell

I have a jump off server, which grants SSH access to a few other servers. I would like to create a custom shell which can be assigned to specific user accounts which runs a menu script upon login, where they can select which server they want to jump too, however should they hit ctrl-c or any... (1 Reply)
Discussion started by: JayC89
1 Replies

10. Shell Programming and Scripting

Awking custom output

i have data that can look like this: echo "Master_Item_Service_is_down=0_njava_lang_NoClassDefFoundError=0_njava_lang_OutOfMemoryError=1_nemxCommonAppInitialization__Error_while_initializing=0_nINFO__Stopping_Coyote_HTTP_1_1_on_http_8080=7_nThe_file_or_directory_is_corrupted_and_unreadable=0_n" ... (7 Replies)
Discussion started by: SkySmart
7 Replies
Building Custom Topologies(3)				     Hardware Locality (hwloc)				     Building Custom Topologies(3)

NAME
Building Custom Topologies - Functions int hwloc_custom_insert_topology (hwloc_topology_t newtopology, hwloc_obj_t newparent, hwloc_topology_t oldtopology, hwloc_obj_t oldroot) hwloc_obj_t hwloc_custom_insert_group_object_by_parent (hwloc_topology_t topology, hwloc_obj_t parent, int groupdepth) Detailed Description A custom topology may be initialized by calling hwloc_topology_set_custom() after hwloc_topology_init(). It may then be modified by inserting objects or entire topologies. Once done assembling, hwloc_topology_load() should be invoked as usual to finalize the topology. Function Documentation hwloc_obj_t hwloc_custom_insert_group_object_by_parent (hwloc_topology_ttopology, hwloc_obj_tparent, intgroupdepth) Insert a new group object inside a custom topology. An object with type HWLOC_OBJ_GROUP is inserted as a new child of object parent. groupdepth is the depth attribute to be given to the new object. It may for instance be 0 for top-level groups, 1 for their children, and so on. The custom topology newtopology must have been prepared with hwloc_topology_set_custom() and not loaded with hwloc_topology_load() yet. parent may be either the root of topology or an object that was added earlier through hwloc_custom_insert_group_object_by_parent(). int hwloc_custom_insert_topology (hwloc_topology_tnewtopology, hwloc_obj_tnewparent, hwloc_topology_toldtopology, hwloc_obj_toldroot) Insert an existing topology inside a custom topology. Duplicate the existing topology oldtopology inside a new custom topology newtopology as a leaf of object newparent. If oldroot is not NULL, duplicate oldroot and all its children instead of the entire oldtopology. Passing the root object of oldtopology in oldroot is equivalent to passing NULL. The custom topology newtopology must have been prepared with hwloc_topology_set_custom() and not loaded with hwloc_topology_load() yet. newparent may be either the root of newtopology or an object that was added through hwloc_custom_insert_group_object_by_parent(). Author Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. Version 1.4.1 Mon Feb 27 2012 Building Custom Topologies(3)
All times are GMT -4. The time now is 09:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy