Sponsored Content
Full Discussion: Second Column Read
Top Forums Shell Programming and Scripting Second Column Read Post 302361349 by dinjo_jo on Tuesday 13th of October 2009 03:59:04 AM
Old 10-13-2009
var would contain something like

1 ABC 2 DEF 3 IOP

But when i write it to a file it gets format like below -

1 ABC
2 DEF
3 IOP

What I need is firstly the id then i require the second column values for further processing.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to read the column and print the values under that column

hi all:b:, how to read the column and print the values under that column ...?? file1 have something like this cat file1 ======= column1, column2,date,column3,column4..... 1, 23 , 12/02/2008,...... 2, 45, 14/05/2008,..... 3, 56, 16/03/2008,..... cat file2 =======... (6 Replies)
Discussion started by: gemini106
6 Replies

2. Shell Programming and Scripting

How to read a specific column into variable

Hi, I want to read the 3rd column of the v_string into a script variable v_3rd, can anyone help howto? v_string="This is for testing only" Thanks! Victor Cheung (2 Replies)
Discussion started by: victorcheung
2 Replies

3. UNIX for Dummies Questions & Answers

how to read the first and last column of the attached file

Dear All, I need a small script which will read from a txt file the first and and second and the last clumn of the file and determine how many are having +000 ,+024,+048 error codes. Please help me as soon as possible. Rgrds, A.Ali (2 Replies)
Discussion started by: samura
2 Replies

4. Shell Programming and Scripting

read column values one after another

hi, Can some one help me how to retrieve column values row by row My requirement is like below : I have a text file having comma seperated values of these records . OName OType SrcDB Sschema targetdb TSchema Load Dataype processY/N aa Table a e i m Y db2 y aa index b c d e N sql N ... (4 Replies)
Discussion started by: sailaja_80
4 Replies

5. Shell Programming and Scripting

Read CSV column value based on column name

Hi All, I am newbie to Unix I ve got assignment to work in unix can you please help me in this regard There is a sample CSV file "Username", "Password" "John1", "Scot1" "John2", "Scot2" "John3", "Scot3" "John4", "Scot4" If i give the column name as Password and row number as 4 the... (3 Replies)
Discussion started by: JohnGG
3 Replies

6. Shell Programming and Scripting

How to read different lines into column

Dear experts, Need your great help ! The input file is as follows: Name: test01 Name UID: C7:9D:79:52:2A:3F:DF:11:A8:64:00:60:16:36:04:02 Shareable: YES HBA/SP Pairs: HBA UID SP Name SPPort ------- ... (9 Replies)
Discussion started by: tojzz
9 Replies

7. Shell Programming and Scripting

how to read a certain column from the status result

I am using this script to get the status of the running process VAR=$(ps -ef | grep batch_proc_x | grep -v grep) echo $VAR now it returns this splgwin 13195 13100 0 14:13:13 pts/tb 0:00 /usr/bin/ksh ./batch_proc_x.sh now is there a way to read that time 14:13:13 directly from... (2 Replies)
Discussion started by: akabir77
2 Replies

8. Programming

Read column into hash

Hi, I want to read the __DATA__ into hashes with the first word (indented) of each part as key and the rest of the part (an array as value). Each part of the input is identified by the indentation. i.e. "The Skipper", "Professor", "Gilligan" are three identifiers as they do not have indentation,... (7 Replies)
Discussion started by: yifangt
7 Replies

9. Shell Programming and Scripting

Read column and find differences...

I have this file 427 A C A/C 12 436 G C G/C 12 445 C T C/T 12 447 A G A/G 9 451 T C T/C 5 456 A G A/G 12 493 G A G/A 12 I wanted to read the first column and find all other ids which are differences less than 10. 427 A C A/C 12 436 436 G C G/C 12 427,445... (7 Replies)
Discussion started by: empyrean
7 Replies

10. Shell Programming and Scripting

Read first column and count lines in second column using awk

Hello all, I would like to ask your help here: I've a huge file that has 2 columns. A part of it is: sorted.txt: kss23 rml.67lkj kss23 zhh.6gf kss23 nhd.09.fdd kss23 hp.767.88.89 fl67 nmdsfs.56.df.67 fl67 kk.fgf.98.56.n fl67 bgdgdfg.hjj.879.d fl66 kl..hfh.76.ghg fl66... (5 Replies)
Discussion started by: Padavan
5 Replies
LVMCREATE_INITRD(8)					      System Manager's Manual					       LVMCREATE_INITRD(8)

NAME
lvmcreate_initrd - create an initial ramdisk to boot with root on a logical volume SYNOPSIS
lvcmreate_initrd [-i|--iop IOP] [-D|--devfs] [-v|--verbose] [-V|--version] [KernelVersion] DESCRIPTION
lvmcreate_initrd creates a new compressed initial ramdisk /boot/initrd-lvm-KernelVersion.gz. The initial ramdisk contains all necessary binaries, shared libraries and a linuxrc file to switch to a logical volume based root filesystem. To build an initial ramdisk for a ker- nel other than the one currently running add the KernelVersion parameter (e.g. lvmcreate_initrd 2.3.25) on the command line. OPTIONS -h, --help Print a usage message on standard output and exit. -i, --iop IOP Specify the LVM kernel IOP version if you are using wrapper scripts in /sbin. This is only necessary if you are building an initrd for a kernel other than the current one, and you have tools for multiple IOP versions installed. -D, --devfs Force the use of devfs when building the initrd. lvmcreate_initrd by default probes for devfs by checking for /dev/.devfsd, which is created by devfsd when it is running. This option will force lvmcreate_initrd to do this, when devfsd is not currently running. -v, --verbose Gives verbose runtime information about the creation of the ram disk image. -V, --version Print version number and exit successfully. The necessary actions to change your system into a "root on logical volume" one are: Create a small (~20MB) partition which is BIOS reachable to hold the /boot filesystem (if you already have a small partition based root filesystem this can be used instead). If you want to boot standalone from this partition in an emergency, copy all the necessary binaries and libraries to that filesystem as well and create a corresponding /etc/lilo.conf entry. In order to be able to edit lilo.conf when booted standalone, you should move /etc/lilo.conf to /boot/lilo.conf and create a symbolic link to it in /etc. This is not needed if you have a boot/root floppy which contains the LVM binaries and the library. Create all logical volumes you need (for root, usr, opt etc.), create filesystems in them, mount them and transfer all files from the par- tition based filesystems into the logical volume based ones. Set up your /etc/lilo.conf with a boot configuration like: image = /boot/vmlinuz initrd = /boot/initrd-lvm-KernelVersion.gz root = /dev/YourVG/YourRootLV label = rootonlv append = 'ramdisk_size=8192' Replace YourVG and YourRootLV by your actual volume group and root logical volume names. You also need to change the ramdisk size to be at least as large as that reported while lvmcreate_initrd is run. If you have enough memory, it is OK if the ramdisk size in /etc/lilo.conf is larger than what lvmcreate_initrd reports (the memory is freed after booting). Also, your /etc/fstab in the root logical volume should contain entries for the root LV, and the boot partition, along with any other LVs you have configured: /dev/YourVG/YourRootLV / ext2 defaults 0 1 /dev/YourBootPartition /boot ext2 defaults 0 2 /dev/YourVG/YourUsrLV /usr ext2 defaults 0 3 /dev/YourVG/YourOptLV /opt ext2 defaults 0 4 etc. You can use other supported filesystem types as well (e.g. reiserfs) if you have support for those in your kernel. Run lilo, reboot and try... The partitions containing the former /usr, /opt etc. filesystems can now be used as physical volumes. Use pvcreate(8) to turn them into PVs and then use vgextend(8) to add them to e.g. YourVG. DIAGNOSTICS
lvcmcreate_initrd returns 0 for success. 1 is returned in all other cases. SEE ALSO
lilo(8), lilo.conf(5), fstab(5), lvm(8), pvcreate(8), vgextend(8), lvcreate(8), vgcreate(8) AUTHOR
Heinz Mauelshagen <Linux-LVM@Sistina.com> Heinz Mauelshagen LVM TOOLS LVMCREATE_INITRD(8)
All times are GMT -4. The time now is 07:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy