[go: up one dir, main page]

File: put.news

package info (click to toggle)
suck 4.3.4-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 1,148 kB
  • sloc: ansic: 12,085; perl: 528; sh: 363; makefile: 348; java: 144
file content (34 lines) | stat: -rwxr-xr-x 590 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

# this is just a simple script to use sed to strip off the 
# NNTP_Posting_Host and Xref headers that my ISP's newsfeed 
# doesn't like.  this could be written as a one liner
# sed -e SEDCMD1 $1 | sed SEDCMD2 > $2

#set -x

if [ $# -ne 2 ]; then
	echo
	echo "Usage `basename $0` infile outfile <RETURN>"
	echo
	exit 1
fi

SEDCMD="/^NNTP-Posting-Host/d"
SEDCMD2="/^Xref/d"
OUTFILE=$2
INFILE=$1

if [ -f ${INFILE} ]; then

	sed -e ${SEDCMD} ${INFILE} | sed -e ${SEDCMD2} > ${OUTFILE}
		
	if [ $? -ne 0 ]; then
		echo "Error"
		exit 1
	fi

else
	echo "$1 does not exist"
	exit 1
fi