File: listnewuser.sh

package info (click to toggle)
didiwiki 3.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,912 kB
  • sloc: ansic: 5,985; sh: 1,532; makefile: 27
file content (30 lines) | stat: -rwxr-xr-x 687 bytes parent folder | download
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
#!/bin/sh
# This simple bash script searchs user registrations in newwikiusers.txt
# JP Redonnet August 2010 - inphilly@gmail.com
# newwikiusers.txt should be in the home dir
file1=~/newwikiusers.txt
file2=~/newusersnotified.txt
echo "Search user registrations in newwikiusers.txt"
echo -n "Enter the user name (or all): "
read b
if [ ! $b ] || [ $b = "all" ]
then
    a=U:
else
    a=U:$b
fi

if [ -f "$file1" ]
then
    echo "List of users not notified yet:"
    grep -i $a $file1
    echo "------------------------------"
fi
if [ -f "$file2" ]
then
    echo "List of users alread notified:"
    grep -i $a $file2
    echo "------------------------------"
fi
echo "Press Enter"
read a