Redirecting paste cmd


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Redirecting paste cmd
# 1  
Old 05-18-2011
Redirecting paste cmd

using
Code:
 paste -- sd " "

via command line give sme desired output however when I use
Code:
 >

it changes the format slightly.
Anyone any ideas as to why this may happen

Running
Code:
SunOS alps 5.10 Generic_125100-05 sun4v sparc SUNW,Sun-Fire-T200

# 2  
Old 05-18-2011
What input do you have ?
What output do you expect ?
It looks like your are using erroneous syntaxe for the "paste" command

Code:
paste [-s] [-d list] file...

Code:
man paste

.. so the following syntax you used is not correct :
Code:
paste -- sd " "

... and may just have an undefined random behaviour ...
# 3  
Old 05-18-2011
Hi ctsgnb, the syntax
Code:
 paste -sd " " infile

is one you kindly gave me earlier today and works perfectly well when run from command line. The issue occurs when I try and re-direct it with
Code:
 >

.
This redirection changes into an unrequired format

running
Code:
SunOS alps 5.10 Generic_125100-05 sun4v sparc SUNW,Sun-Fire-T200

# 4  
Old 05-18-2011
Code:
# ls h*
h1  h2  h3  h4  h5
# cat h1
A1
B1
C1
D1
E1
F1
# cat h2
A2
B2
C2
D2
E2
F2
# paste -sd " " h* >z1
# cat z1
A1 B1 C1 D1 E1 F1
A2 B2 C2 D2 E2 F2
A3 B3 C3 D3 E3 F3
A4 B4 C4 D4 E4 F4
A5 B5 C5 D5 E5 F5
#

What is your problem ?
# 5  
Old 05-18-2011
the problem is the format changes when I use the redirect and write to another file.
# 6  
Old 05-18-2011
Please provide an example that demonstrate your problem, just as i demonstrate that for me there are no problems.

If you command line is inside a script, please provide the code of your script
# 7  
Old 05-18-2011
ok here goes

paste outout on cli works fine

Code:
paste -sd " " r*
A1 B1 C1 D1 E1 F1 G1 H1 I1 J1 K1 L1 M1 N1 O1 P1 Q1 R1 S1 T1 U1 V1 W1 X1 Y1 Z1 AA1 AB1 AC1 AD1 AE1 AF1 AG1 AK1 AL1 AM1 AN1 AO1 AP1
A9 B9 C9 D9 E9 F9 G9 H9 I9 J9 K9 L9 M9 N9 O9 P9 Q9 R9 S9 T9 U9 V9 W9 X9 Y9 Z9 AA9 AB9 AC9 AD9 AE9 AF9 AG9 AK9 AL9 AM9 AN9 AO9 AP9
A11 B11 C11 D11 E11 F11 G11 H11 I11 J11 K11 L11 M11 N11 O11 P11 Q11 R11 S11 T11 U11 V11 W11 X11 Y11 Z11 AA11 AB11 AC11 AD11 AE11 AF11 AG11 AK11 AL11 AM11 AN11 AO11 AP11
A12 B12 C12 D12 E12 F12 G12 H12 I12 J12 K12 L12 M12 N12 O12 P12 Q12 R12 S12 T12 U12 V12 W12 X12 Y12 Z12 AA12 AB12 AC12 AD12 AE12 AF12 AG12 AK12 AL12 AM12 AN12 AO12 AP12
A13 B13 C13 D13 E13 F13 G13 H13 I13 J13 K13 L13 M13 N13 O13 P13 Q13 R13 S13 T13 U13 V13 W13 X13 Y13 Z13 AA13 AB13 AC13 AD13 AE13 AF13 AG13 AK13 AL13 AM13 AN13 AO13 AP13
A14 B14 C14 D14 E14 F14 G14 H14 I14 J14 K14 L14 M14 N14 O14 P14 Q14 R14 S14 T14 U14 V14 W14 X14 Y14 Z14 AA14 AB14 AC14 AD14 AE14 AF14 AG14 AK14 AL14 AM14 AN14 AO14 AP14
A15 B15 C15 D15 E15 F15 G15 H15 I15 J15 K15 L15 M15 N15 O15 P15 Q15 R15 S15 T15 U15 V15 W15 X15 Y15 Z15 AA15 AB15 AC15 AD15 AE15 AF15 AG15 AK15 AL15 AM15 AN15 AO15 AP15
A16 B16 C16 D16 E16 F16 G16 H16 I16 J16 K16 L16 M16 N16 O16 P16 Q16 R16 S16 T16 U16 V16 W16 X16 Y16 Z16 AA16 AB16 AC16 AD16 AE16 AF16 AG16 AK16 AL16 AM16 AN16 AO16 AP16
A17 B17 C17 D17 E17 F17 G17 H17 I17 J17 K17 L17 M17 N17 O17 P17 Q17 R17 S17 T17 U17 V17 W17 X17 Y17 Z17 AA17 AB17 AC17 AD17 AE17 AF17 AG17 AK17 AL17 AM17 AN17 AO17 AP17
A18 B18 C18 D18 E18 F18 G18 H18 I18 J18 K18 L18 M18 N18 O18 P18 Q18 R18 S18 T18 U18 V18 W18 X18 Y18 Z18 AA18 AB18 AC18 AD18 AE18 AF18 AG18 AK18 AL18 AM18 AN18 AO18 AP18
A19 B19 C19 D19 E19 F19 G19 H19 I19 J19 K19 L19 M19 N19 O19 P19 Q19 R19 S19 T19 U19 V19 W19 X19 Y19 Z19 AA19 AB19 AC19 AD19 AE19 AF19 AG19 AK19 AL19 AM19 AN19 AO19 AP19
A2 B2 C2 D2 E2 F2 G2 H2 I2 J2 K2 L2 M2 N2 O2 P2 Q2 R2 S2 T2 U2 V2 W2 X2 Y2 Z2 AA2 AB2 AC2 AD2 AE2 AF2 AG2 AK2 AL2 AM2 AN2 AO2 AP2
A20 B20 C20 D20 E20 F20 G20 H20 I20 J20 K20 L20 M20 N20 O20 P20 Q20 R20 S20 T20 U20 V20 W20 X20 Y20 Z20 AA20 AB20 AC20 AD20 AE20 AF20 AG20 AK20 AL20 AM20 AN20 AO20 AP20
A21 B21 C21 D21 E21 F21 G21 H21 I21 J21 K21 L21 M21 N21 O21 P21 Q21 R21 S21 T21 U21 V21 W21 X21 Y21 Z21 AA21 AB21 AC21 AD21 AE21 AF21 AG21 AK21 AL21 AM21 AN21 AO21 AP21
A22 B22 C22 D22 E22 F22 G22 H22 I22 J22 K22 L22 M22 N22 O22 P22 Q22 R22 S22 T22 U22 V22 W22 X22 Y22 Z22 AA22 AB22 AC22 AD22 AE22 AF22 AG22 AK22 AL22 AM22 AN22 AO22 AP22
A23 B23 C23 D23 E23 F23 G23 H23 I23 J23 K23 L23 M23 N23 O23 P23 Q23 R23 S23 T23 U23 V23 W23 X23 Y23 Z23 AA23 AB23 AC23 AD23 AE23 AF23 AG23 AK23 AL23 AM23 AN23 AO23 AP23
A24 B24 C24 D24 E24 F24 G24 H24 I24 J24 K24 L24 M24 N24 O24 P24 Q24 R24 S24 T24 U24 V24 W24 X24 Y24 Z24 AA24 AB24 AC24 AD24 AE24 AF24 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 L1 M1 N1 O1 P1 Q1 R1 S1 T1 U1 V1 W1 X1 Y1 Z1 AA1 AB1 AC1 AD1 AE1 AF1 AG1 AK1 AL1 AM1 AN1 AO1 AP1
A9 B9 C9 D9 E9 F9 G9 H9 I9 J9 K9 L9 M9 N9 O9 P9 Q9 R9 S9 T9 U9 V9 W9 X9 Y9 Z9 AA9 AB9 AC9 AD9 AE9 AF9 AG9 AK9 AL9 AM9 AN9 AO9 AP9
A11 B11 C11 D11 E11 F11 G11 H11 I11 J11 K11 L11 M11 N11 O11 P11 Q11 R11 S11 T11 U11 V11 W11 X11 Y11 Z11 AA11 AB11 AC11 AD11 AE11 AF11 AG11 AK11 A
L11 AM11 AN11 AO11 AP11
A12 B12 C12 D12 E12 F12 G12 H12 I12 J12 K12 L12 M12 N12 O12 P12 Q12 R12 S12 T12 U12 V12 W12 X12 Y12 Z12 AA12 AB12 AC12 AD12 AE12 AF12 AG12 AK12 A
L12 AM12 AN12 AO12 AP12
A13 B13 C13 D13 E13 F13 G13 H13 I13 J13 K13 L13 M13 N13 O13 P13 Q13 R13 S13 T13 U13 V13 W13 X13 Y13 Z13 AA13 AB13 AC13 AD13 AE13 AF13 AG13 AK13 A
L13 AM13 AN13 AO13 AP13
A14 B14 C14 D14 E14 F14 G14 H14 I14 J14 K14 L14 M14 N14 O14 P14 Q14 R14 S14 T14 U14 V14 W14 X14 Y14 Z14 AA14 AB14 AC14 AD14 AE14 AF14 AG14 AK14 A
L14 AM14 AN14 AO14 AP14
A15 B15 C15 D15 E15 F15 G15 H15 I15 J15 K15 L15 M15 N15 O15 P15 Q15 R15 S15 T15 U15 V15 W15 X15 Y15 Z15 AA15 AB15 AC15 AD15 AE15 AF15 AG15 AK15 A
L15 AM15 AN15 AO15 AP15
A16 B16 C16 D16 E16 F16 G16 H16 I16 J16 K16 L16 M16 N16 O16 P16 Q16 R16 S16 T16 U16 V16 W16 X16 Y16 Z16 AA16 AB16 AC16 AD16 AE16 AF16 AG16 AK16 A
L16 AM16 AN16 AO16 AP16
A17 B17 C17 D17 E17 F17 G17 H17 I17 J17 K17 L17 M17 N17 O17 P17 Q17 R17 S17 T17 U17 V17 W17 X17 Y17 Z17 AA17 AB17 AC17 AD17 AE17 AF17 AG17 AK17 A
L17 AM17 AN17 AO17 AP17
A18 B18 C18 D18 E18 F18 G18 H18 I18 J18 K18 L18 M18 N18 O18 P18 Q18 R18 S18 T18 U18 V18 W18 X18 Y18 Z18 AA18 AB18 AC18 AD18 AE18 AF18 AG18 AK18 A
L18 AM18 AN18 AO18 AP18
A19 B19 C19 D19 E19 F19 G19 H19 I19 J19 K19 L19 M19 N19 O19 P19 Q19 R19 S19 T19 U19 V19 W19 X19 Y19 Z19 AA19 AB19 AC19 AD19 AE19 AF19 AG19 AK19 A
L19 AM19 AN19 AO19 AP19
A2 B2 C2 D2 E2 F2 G2 H2 I2 J2 K2 L2 M2 N2 O2 P2 Q2 R2 S2 T2 U2 V2 W2 X2 Y2 Z2 AA2 AB2 AC2 AD2 AE2 AF2 AG2 AK2 AL2 AM2 AN2 AO2 AP2
A20 B20 C20 D20 E20 F20 G20 H20 I20 J20 K20 L20 M20 N20 O20 P20 Q20 R20 S20 T20 U20 V20 W20 X20 Y20 Z20 AA20 AB20 AC20 AD20 AE20 AF20 AG20 AK20 A
L20 AM20 AN20 AO20 AP20
A21 B21 C21 D21 E21 F21 G21 H21 I21 J21 K21 L21 M21 N21 O21 P21 Q21 R21 S21 T21 U21 V21 W21 X21 Y21 Z21 AA21 AB21 AC21 AD21 AE21 AF21 AG21 AK21 A
L21 AM21 AN21 AO21 AP21
A22 B22 C22 D22 E22 F22 G22 H22 I22 J22 K22 L22 M22 N22 O22 P22 Q22 R22 S22 T22 U22 V22 W22 X22 Y22 Z22 AA22 AB22 AC22 AD22 AE22 AF22 AG22 AK22 A
L22 AM22 AN22 AO22 AP22
A23 B23 C23 D23 E23 F23 G23 H23 I23 J23 K23 L23 M23 N23 O23 P23 Q23 R23 S23 T23 U23 V23 W23 X23 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9 L9 M9 N9 O9 P9 Q9 R9 S9 T9 U9 V9 W9 X9 Y9 Z9 AA9 AB9 AC9 AD9 AE9 AF9 AG9 AK9 AL9 AM9 AN9 AO9 AP9

I should also add that I need to have these in order so

Code:
A1 B1 C1 D1 E1...
A2 B2 C2 D2 E2...
A3 B3 C3 D3 E3...
A4 B4 C4 D4 E4...


Last edited by rob171171; 05-18-2011 at 10:43 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with cmd while using ps

Hi i am new to shell scripting and any help is really appreciated. my requirement is in, ps -e -o pid,uname,cmd how can i split and take only the cmd part from it. I tried awk but the issue is when the cmd is returning a lengthy command which itself has some spaces it is truncating the... (7 Replies)
Discussion started by: Jojo90
7 Replies

2. Shell Programming and Scripting

How to paste string yanked into an edit in cmd mode?

I have 2 files open in Vim at the same time. I yank from one with 16yw and get this INSERT INTO ALIS_PART_MANU_PART_TAB (SEQUENCE_NO,PART_NO,MANU_NO,MANU_PART_NO,ROWVERSION) VALUES ( Now I go to the second file and type the command to add this to the beginning of every... (3 Replies)
Discussion started by: djehresmann
3 Replies

3. Shell Programming and Scripting

Perl open(CMD, "cmd |"); buffering problem..

Hello, There's a third-party application's command that shows the application's status like "tail -f verybusy.log". When use the command, the output comes every 1-sec. but when it goes in a script below the output comes every 8-sec...What is the problem and how can I fix it? open(CMD,... (2 Replies)
Discussion started by: Shawn, Lee
2 Replies

4. Shell Programming and Scripting

redirecting help

I am trying to create the file and redirect the output in the same command line which is line 4 in the below program. #!/bin/bash read -p "Enter File Name:" value1 echo "Your File Name is $value1" sed 's/abcd/'$value1'/g' abcd_calls > $value1_calls This is the error it generates ... (3 Replies)
Discussion started by: learnbash
3 Replies

5. Shell Programming and Scripting

Unix cmd prompt how to get old cmd run?

Hi, I am using SunOS I want to serch my previous command from unix prompt (like on AIX we can search by ESC -k) how to get in SunOs urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies

6. UNIX for Dummies Questions & Answers

Paste

paste -d "\0" ap_cntrl_total.txt.1 ap_cntrl_total.txt.2, and it shows: 01234567890911051342C091026 0000910517990000000000009105179900000000CHOPME it put space btwn 1026 and 000091 should not have space. ---------- Post updated at 03:54 PM ---------- Previous update was at 03:03 PM... (1 Reply)
Discussion started by: tjmannonline
1 Replies

7. Shell Programming and Scripting

aside from paste

how can i make a script or command to have output like this $cat file 10000 20000 $cat a 10000 $cat b 20000 this is the solution paste a b > file but another solution? $cat file 10000 20000 (3 Replies)
Discussion started by: kenshinhimura
3 Replies

8. UNIX for Advanced & Expert Users

MX redirecting

I in no means consider myself a expert in unix however my question is a little more complex. I am running a mac os 10 server and all web settings and email settings have been set up using the unix terminal. I am in the process or redirecting my mxrecords to a spam filtering company but i am... (11 Replies)
Discussion started by: nbredthauer
11 Replies

9. UNIX for Dummies Questions & Answers

mv cmd

Hi All, How can I move only files to another destination using mv cmd in hp-ux. (2 Replies)
Discussion started by: mhbd
2 Replies

10. UNIX for Dummies Questions & Answers

man <cmd> >> cmd.txt

I've noticed most of my postings here are because of syntax errors. So I want to begin compiling a large txt file that contains all the "man <cmd>" of the commands I most have problems with. I ran a "man nawk >> nawk.txt" but it included a header/footer on each "page". Anyone know how I'd be... (6 Replies)
Discussion started by: yongho
6 Replies
Login or Register to Ask a Question