File: rentidy.sh

package info (click to toggle)
tidy-html5 2%3A5.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,668 kB
  • sloc: ansic: 43,061; ruby: 1,368; sh: 404; xml: 225; cpp: 30; makefile: 26
file content (39 lines) | stat: -rwxr-xr-x 589 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
#< rentidy.sh - 20160201
BN=`basename $0`

ask()
{
    pause
    if [ ! "$?" = "0" ]; then
        exit 1
    fi
}

TMPEXE="/usr/bin/tidy"
if [ ! -f "$TMPEXE" ]; then
    echo "$BN: Can not locate '$TMPEXE'"
    exit 1
fi
# tidy -v
$TMPEXE -v
if [ ! "$?" = "0" ]; then
    echo "$BN: Can not run $TMPEXE!"
    exit 1
fi
TMPVER=`$TMPEXE -v | awk '{ print $6 }'`
# echo "$BN: Version $TMPVER"
TMPFIL2="$TMPEXE-$TMPVER"
if [ -f "$TMPFIL2" ]; then
    echo "$BN: New name already exists!"
    exit 1
fi
echo "$BN: Rename $TMPEXE to $TMPFIL2?"

ask

sudo mv $TMPEXE $TMPFIL2


# eof