PCPRINT+CRLF perl script


V

vjp2.at

How do I make this as simple as possible using perl instead of sed


pcprint () { sed 's/$//' < $1 >> ~/pcprint.tmp; echo ' ' >> pcprint.tmp ; /usr/local/bin/pcprint ~/pcprint.tmp ; rm ~/pcprint.tmp ;}

Following is someone's pcprint script
(I'm not sure what $# -eq and cat$* mean)

#!/bin/sh
# pcprint
echo -n ''
if [ $# -eq 0 ]; then
cat
else
cat $*
fi
echo -n ''




- = -
Vasos-Peter John Panagiotopoulos II, Columbia'81+, Bio$trategist
BachMozart ReaganQuayle EvrytanoKastorian
http://ourworld.compuserve.com/homepages/vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
[Health Reform means abolishing FDR's insurance tax exemption]
[To stop SPAM, Charge net-postage] [Abolish 16th (Inc Tx) Amendment]
 
Ad

Advertisements

T

Tad McClellan

How do I make this as simple as possible using perl instead of sed


pcprint () { sed 's/$//' < $1 >> ~/pcprint.tmp; echo ' ' >> pcprint.tmp ;
^^^
^^^

replace

sed

with

perl -pe
 
Ad

Advertisements

J

John W. Krahn

How do I make this as simple as possible using perl instead of sed

pcprint () { sed 's/$/
/' < $1 >> ~/pcprint.tmp; echo ' ' >> pcprint.tmp ; /usr/local/bin/pcprint ~/pcprint.tmp ; rm ~/pcprint.tmp ;}

man s2p


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

* or x ? 2
Java update blocks 3
Android pointers 0
Command-line HTML Post-method (medline in lynx) 7
Indicators in Google Finance Spreadsheets 0
Online Link Checker 3
mailto vs mail.php 2
POST 0

Top