Truncated with a pipe?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Truncated with a pipe?
# 1  
Old 11-14-2005
Truncated with a pipe?

OK, I'm stumped.

I have a shell script that reads a list, and for every item in the list performs a lookup in our Active Directory. Now, it seems that when I pipe the results into grep, the complete results are not there (truncated?). I'm not sure if this is a limit of the pipe, grep, shell script or what. The thing is, when I just echo the command into a file, all the info is there, but when I echo into a file after a pipe, it's not.

This poses an issue because from the pipe, I need to grep for something. The problem is, the something is not there. If I run the same exact command from the command line, it works. It seems that when running the command from a shell script, it can only handle a certain size result??

Running OS X 10.4.3

Thanks for any help!
# 2  
Old 11-14-2005
try putting an intermidiate 'cat' before your 'grep':

myScript | cat | grep

It might be a case of 'buffering'. Having a 'cat' [no pun intended] acts as a 'valve' flushing the complete output of 'myScript' into the pipped 'grep'.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parameter getting truncated using stanzaget

Hi, My script reading parameters from a parameter file using stanzaget. (runs on ksh). One of the paramter is collection of unique numbers separated by comma and it is lengthy. Parameter file looks as below, GLOBAL: ACTIVE_STORES = 00001,00002, ----- up to 01000 wc -c... (1 Reply)
Discussion started by: Gajendra_PH
1 Replies

2. UNIX for Dummies Questions & Answers

Ps -ef, output getting truncated, please help

Hi All, here is an output of my command and the problem is that my output string is truncated, I want to exact the full string, I am on BASH shell, please help me out. Regards Rahul command with Output : lonss05903:cmdsvc01 /home/cmdsvc01 > ps -aef|grep 'Copy' cmdsvc01 2642 8675 ... (7 Replies)
Discussion started by: rahulkalra9
7 Replies

3. Solaris

ps output truncated

Hi, I have Solaris-10 server. /usr/ucb/ps auxww is showing full path if I am running it from root. But if I run it from non-root user, its output is truncated. I don't want to use any other alternate command. Please suggest, what can be its solution. Terminal is set to term. (21 Replies)
Discussion started by: solaris_1977
21 Replies

4. Shell Programming and Scripting

Leading zero's getting truncated on columns

Hi All, I have a input file named 'inputtest.txt' like below: "335588","DW02.CAPTURED_ROC_14","13016063","00000000000001541897035.77" "335587","DW02.NCL01_1ST_PSMT_14","446301","00000000000000040370306.43" My desired output will be like below: 335588 DW02.CAPTURED_ROC_14 13016063 ... (3 Replies)
Discussion started by: Arunprasad
3 Replies

5. UNIX for Dummies Questions & Answers

output from sed getting truncated

Hi all, I have used sed command with a file of size 7KB and stored the output to another file. When i look into the output file, a few file lines at the bottom have got truncated. The sed statement i used is as below. Why does this happen and how to resolve this. SQL=`sed... (3 Replies)
Discussion started by: madhan@29
3 Replies

6. UNIX for Dummies Questions & Answers

File gets truncated

Hi Guys, I have a master script file. That calls the other script files. The sub script files append some of the data to the log file. Once the master script completes one sub script execution and returns to execute other sub script that appends to the same log file. the log file gets... (2 Replies)
Discussion started by: Swapna173
2 Replies

7. AIX

PS truncated in AIX

folks; how can i get longer output than the one i got by using "/usr/ucb/ps awwx"? :mad: (2 Replies)
Discussion started by: moe2266
2 Replies

8. Solaris

ps truncated output

Hi Problem of ps on Solaris 8 and 9 Perhaps a silly question but I can't find a solution. the output of the command ps -ef is truncated. I've tried to change the terminal settings with stty putting a big number of colums: no change. Following the man page of ps i have set the variable... (8 Replies)
Discussion started by: renoc
8 Replies

9. UNIX for Advanced & Expert Users

ps output truncated

Hi! I have some shell scripts receiving in input lots of parameters and I need to select the ones having a particular value in one parameter. A typical shell command line is: PROMPT > shell_name.ksh -avalue_a -bvalue_b -cvalue_c -dvalue_d ... I used a combinaton of ps and grep commands... (5 Replies)
Discussion started by: pciatto
5 Replies

10. Shell Programming and Scripting

ps output truncated

Hi! I have some shell scripts receiving in input lots of parameters and I need to select the ones having a particular value in one parameter. A typical shell command line is: PROMPT > shell_name.ksh -avalue_a -bvalue_b -cvalue_c -dvalue_d ... I used a combinaton of ps and grep commands... (1 Reply)
Discussion started by: pciatto
1 Replies
Login or Register to Ask a Question