File: delqueueask

package info (click to toggle)
rccp 0.9-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 244 kB
  • ctags: 44
  • sloc: ansic: 830; sh: 256; perl: 134; makefile: 71
file content (38 lines) | stat: -rwxr-xr-x 789 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
35
36
37
38
#!/bin/sh
#CCCP script by hampa@chello.se
#delete dctc queue scripte
#shows the queye list and let you choose what to delete
exec 6<&0
count=0

cccp -q > /tmp/cccp_tmp.txt 2>/dev/null
exec < /tmp/cccp_tmp.txt
while read line
do
	let "count += 1"
	#echo $count $line
	#echo $line 
	all[$count]=$line
	echo $count - ${all[$count]}
done

if [ "$count" = "0" ]
then 
	echo No transfer found
	exit 0
fi

exec 0<&6 6<&-
#cat 1.txt | awk '{printf("%i %s\n", FNR, $0)}'
echo "enter line number to remove or q to quit: "
while read item
do
#echo $item
	if [ "$item" = "q" ]
	then
		exit 0
	fi
	echo ${all[$item]} |  cut -c10- | cut -d\| -f 1 | xargs -n1 -exec cccp -O -k
	echo "enter line number to remove or q to quit: "
	#echo ${all[$item]} | cccp -q | cut -c10-18 | xargs -n1 -exec cccp -k
done