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]
 
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
 
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


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top