Sponsored Content
Full Discussion: Relocation strings
Top Forums Shell Programming and Scripting Relocation strings Post 302971901 by Don Cragun on Tuesday 26th of April 2016 07:05:11 PM
Old 04-26-2016
Perhaps something like:
Code:
awk '
NR > 1 && last != $1 {
	printf("\n")
}
last != $1 {
	printf("%s", $2)
	last = $1
	next
}
{	printf(" %s", $2)
}
END {	printf("\n")
}' file

which with your sample data in a file named file produces the output:
Code:
path_sparc_ifu_dec_104 path_sparc_ifu_dec_105
path_sparc_ifu_dec_63 path_sparc_ifu_dec_92
path_sparc_ifu_dec_39
path_sparc_ifu_dec_43 path_sparc_ifu_dec_71
path_sparc_ifu_dec_103
path_sparc_ifu_dec_99
path_sparc_ifu_dec_55 path_sparc_ifu_dec_75 path_sparc_ifu_dec_93

which doesn't have any trailing spaces (unlike your sample output which sometimes has trailing spaces and sometimes does not have trailing spaces) and which has a single space between output fields (unlike your sample output which has varying numbers of spaces between output fields).

As always, if you want to try this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk or nawk.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

relocation error

when running make command i'm getting the following error: make:relocation error:make:symbol_sprintf_chk,version GLIBC_2.3.4 not defined in file libc.so.6 with link time reference... plz tell me what to do abt this... (1 Reply)
Discussion started by: abhi1826
1 Replies

2. Programming

relocation truncated to fit errors

I have 2 directories: a1 and b1 Directory b1 depends on directory a1 Using directory a1, I create a1.lib Using directory b1, I create b1.lib Now, using a1 and b1, I create a shared object ab1.so I've been able to build ab1.so just fine. I made an update to file b1.c and am now getting a... (1 Reply)
Discussion started by: houdini_1
1 Replies

3. Programming

ld.so.1: relocation error

Hi Iam getting the following error... ld.so.1: xxxx: fatal: relocation error: file /home/costar4/bin/xxxx: symbol __1cH__rwstdUInterlockedIncrement6Fpl_l_: referenced symbol not found. Can anyone tell me anything in this ? Thanks, Sanja (1 Reply)
Discussion started by: sanjasam
1 Replies

4. UNIX for Advanced & Expert Users

relocation error: yyparse referenced symbol not found

This is my set up: LD_LIBRARY_PATH=/apps/rogue_wave_sol7/workspaces/workshop6_u1/4d/lib:/apps/fu/section20/vendorLib/EMS/4.2/lib:/home/a487891/cppunit/lib:/usr/openwin/lib:/usr/lib ldd -d TestDatalinkTradeRouter libintl.so => /usr/lib/libintl.so libw.so.1 => /usr/lib/libw.so.1... (2 Replies)
Discussion started by: agilgeous
2 Replies

5. Solaris

fatal: relocation error: R_SPARC_WDISP22

Hello, I wonder if anyone has a clue what could be wrong. I get the following error on SUN Netra-T4 server when some applications try to start (e.g. slpd) also even if I try commands such as "jar" I get the same error: ld.so.1: /usr/java1.2/jre/bin/sparc/native_threads/java: fatal:... (3 Replies)
Discussion started by: Juha
3 Replies

6. Linux

relocation truncated to fit

Hi, I am getting linking error i.e. /ade/aime_urtk/oracle/has/include/caa_ResStateListener.hxx:79: relocation truncated to fit: R_PPC_GO T16 vtable for CAA::ResourceStateListener /ade/aime_urtk/oracle/has/lib//libcaad.a(caa_Main.o)(.text+0x88e6): In function `CAA::ResourceStateL... (0 Replies)
Discussion started by: jgobbur
0 Replies

7. Web Development

Svn repository relocation

Hi, I have a svn setup with multiple code repositories. Recently the filesystem holds the repository got full and i wanted to have to move some code repositories to another filesystem. I copied some of the code repositored using the "mv" command to another filesystem and created a symlink with... (1 Reply)
Discussion started by: arumon
1 Replies

8. Shell Programming and Scripting

Need to execute Oracle relocation command in shell script

Hello, I need to execute below command in shell script srvctl relocate service -d $database -s $service -i $avail -t $pref -f and also need to get the errors ,if any,in another file. What's the right way to execute such commands in shell script? Best regards, Vishal (1 Reply)
Discussion started by: Vishal_dba
1 Replies

9. Shell Programming and Scripting

Relocation strings using awk/sed from a index file

Hi All, I'd always appreciate all helps from this website. I would like to relocate strings based on the index number from an index file. Index numbers are shown on the first column in the index file (index.txt) and I would like to relocate "path" based on index numbers. Paths are placed... (11 Replies)
Discussion started by: jypark22
11 Replies
PSC(1)							      General Commands Manual							    PSC(1)

NAME
psc - prepare sc files SYNOPSIS
psc [-fLkrSPv] [-s cell] [-R n] [-C n] [-n n] [-d c] DESCRIPTION
Psc is used to prepare data for input to the spreadsheet calculator sc(1). It accepts normal ascii data on standard input. Standard out- put is a sc file. With no options, psc starts the spreadsheet in cell A0. Strings are right justified. All data on a line is entered on the same row; new input lines cause the output row number to increment by one. The default delimiters are tab and space. The column for- mats are set to one larger than the number of columns required to hold the largest value in the column. OPTIONS
-f Omit column width calculations. This option is for preparing data to be merged with an existing spreadsheet. If the option is not specified, the column widths calculated for the data read by psc will override those already set in the existing spreadsheet. -L Left justify strings. -k Keep all delimiters. This option causes the output cell to change on each new delimiter encountered in the input stream. The default action is to condense multiple delimiters to one, so that the cell only changes once per input data item. -r Output the data by row first then column. For input consisting of a single column, this option will result in output of one row with multiple columns instead of a single column spreadsheet. -s cell Start the top left corner of the spreadsheet in cell. For example, -s B33 will arrange the output data so that the spreadsheet starts in column B, row 33. -R n Increment by n on each new output row. -C n Increment by n on each new output column. -n n Output n rows before advancing to the next column. This option is used when the input is arranged in a single column and the spreadsheet is to have multiple columns, each of which is to be length n. -d c Use the single character c as the delimiter between input fields. -P Plain numbers only. A field is a number only when there is no imbedded [-+eE]. -S All numbers are strings. -v Print the version of psc SEE ALSO
sc(1) AUTHOR
Robert Bond PSC 7.16 19 September 2002 PSC(1)
All times are GMT -4. The time now is 12:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy