Help in adding text before columns in shell script
Hello,
Can someone please help in below requirement.
My requirement is to add date before to first column,some text before 1st,2nd coulmns and insert a new column in between 2 and 3 columns.
Hi this is quite simple i am sure but without using awk or sed i need to add text to the top of a file this is what i have got so far
#!bin/bash
echo "Add text to top of file"
read line
echo $line >> file1
This adds the text to the bottom of the file can some1 please help cheers (7 Replies)
I want to add options to my shell script but having problems, my code so far is;
#!/bin/bash
lflag=
iflag=
while getopts 'l:i:' OPTION
do
case $OPTION in
l) lflag=1
lval="$OPTARG"
;;... (1 Reply)
Good afternoon to everyone,
I have some input and output from various widgets that I am trying to get to play nicely together. Basically I would like to stay out of excel and be able to automate the entire process. I have read some posts here about how to use awk, nawk, etc, to do similar... (9 Replies)
I have 3 variables with different information.. they look like this (row-wise aswell):
Variable1 =
Roland
Kalle
Dalius
Variable2 =
ake123
ler321
kaf434
Variable3 =
Richardsen
Sworden
Lokthar
How can I sort them by variable3 alphabetical and add them into the same output so... (0 Replies)
Hello
I have a file as below
chr1 start ref alt code1 code2
chr1 18884 C CAAAA 2 0
chr1 135419 TATACA T 2 0
chr1 332045 T TTG 0 2
chr1 453838 T TAC 2 0
chr1 567652 T TG 1 0
chr1 602541 ... (2 Replies)
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
Hello,
I am very now to this, hope you can help,
I am looking into editing a file in Solaris, with dinamic collums (lenght varies) and I need 2 things to be made, the fist is to filter the first column and third column from the file bellow file.txt, and create a new file with the 2 filtered... (8 Replies)
the first line of every unix script written in an interpreted language always has a "#!<path-to-the-language>"
is there a way to include other text in that first line without it affecting the ability of the script to run???
for instance, if i change the following line:
#!/bin/sh
echo blah... (1 Reply)
Hi Experts,
I've got this problem where I need to add two array in shell script such that that is an element is greater than 9 then it get further split into individual digit, something like below :
Input :-
array1=(2 6 8 9 10 12)
array2=(5 4 6 8 12 14)
Output :-
array3=(7 1 0 1 4 1 7 2 2... (8 Replies)
I have two files, file1 and file2 who have identical number of rows and columns. However, the script is supposed to be used for for different files and I cannot know the format in advance. Also, the number of columns changes within the file, some rows have more and some less columns (they are... (13 Replies)
Discussion started by: maya3
13 Replies
LEARN ABOUT CENTOS
hwloc_get_obj_below_by_type
Advanced Traversal Helpers(3) Hardware Locality (hwloc) Advanced Traversal Helpers(3)NAME
Advanced Traversal Helpers -
Functions
unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *restrict objs, unsigned max)
static inline hwloc_obj_t hwloc_get_obj_below_by_type (hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t
type2, unsigned idx2)
static inline hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
Detailed Description
Be sure to see the figure in termsanddefs that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an
example of an asymmetric topology where one socket has fewer caches than its peers.
Function Documentation
unsigned hwloc_get_closest_objs (hwloc_topology_ttopology, hwloc_obj_tsrc, hwloc_obj_t *restrictobjs, unsignedmax)
Do a depth-first traversal of the topology to find and sort. all objects that are at the same depth than src. Report in objs up to max
physically closest ones to src.
Returns:
the number of objects returned in objs.
0 if src is an I/O object.
Note:
This function requires the src object to have a CPU set.
static inline hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_ttopology, intnr, hwloc_obj_type_t *typev, unsigned *idxv) [static]
Find an object below a chain of objects specified by types and indexes. This is a generalized version of hwloc_get_obj_below_by_type().
Arrays typev and idxv must contain nr types and indexes.
Start from the top system object and walk the arrays typev and idxv. For each type and logical index couple in the arrays, look under the
previously found object to find the index-th object of the given type. Indexes are specified within the parent, not withing the entire
system.
For instance, if nr is 3, typev contains NODE, SOCKET and CORE, and idxv contains 0, 1 and 2, return the third core object below the second
socket below the first NUMA node.
Note:
This function requires all these objects and the root object to have a CPU set.
static inline hwloc_obj_t hwloc_get_obj_below_by_type (hwloc_topology_ttopology, hwloc_obj_type_ttype1, unsignedidx1, hwloc_obj_type_ttype2,
unsignedidx2) [static]
Find an object below another object, both specified by types and indexes. Start from the top system object and find object of type type1
and logical index idx1. Then look below this object and find another object of type type2 and logical index idx2. Indexes are specified
within the parent, not withing the entire system.
For instance, if type1 is SOCKET, idx1 is 2, type2 is CORE and idx2 is 3, return the fourth core object below the third socket.
Note:
This function requires these objects to have a CPU set.
Author
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code.
Version 1.7 Sun Apr 7 2013 Advanced Traversal Helpers(3)