-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathai
More file actions
executable file
·48 lines (38 loc) · 818 Bytes
/
Copy pathai
File metadata and controls
executable file
·48 lines (38 loc) · 818 Bytes
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
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
igtdContext=""
aiString=""
if [ $# = 1 ]; then
igtdContext=""
aiString="$1"
fi
if [ $# = 2 ]; then
igtdContext="$1"
aiString="$2"
else
echo "Usage: [@context] ai"
fi
today=`date +"%d"`
set cnt="01"
if [ -f $HOME/bin/.ai.count ]; then
day=`cat $HOME/bin/.ai.count | awk '{print $1}'`
cnt=`cat $HOME/bin/.ai.count | awk '{print $2}'`
fi
if [ "$today" = "$day" ]; then
cnt=`expr $cnt + 1`
cnt=`printf "%0.2d\n" $cnt`
echo "$today $cnt" >$HOME/bin/.ai.count
else
cnt="01"
echo "$today $cnt" >$HOME/bin/.ai.count
fi
if [ "$aiString" = "" ]; then
echo 'Enter AI'; read aiString
fi
AINUM=`date +"%m%d%y.$cnt"`
if [ "$igtdContext" = "" ]; then
ai="${AINUM} - ${aiString}"
else
ai="${igtdContext} ${AINUM} - ${aiString}"
fi
echo "${ai}"
#/usr/local/bin/sendtoigtd "${ai}"