root/feedmelinks/bin/detect-bookmarks-file-format.sh

Revision 1368, 359 bytes (checked in by jm3, 2 years ago)

claned

  • Property svn:executable set to *
Line 
1 #!/bin/sh
2
3 file=$1
4
5 if [ -z "$file" ]; then
6   echo "usage: $0 file";
7   exit 1
8 fi
9
10 grep -q "NETSCAPE-Bookmark-file" $file
11 result=$?
12
13 if [ "$result" = 0 ]; then
14   grep -q 'TAGS="' $file
15   result=$?
16   if [ "$result" = 0 ]; then
17     echo delicious-hybrid
18     exit 1
19   fi
20   echo netscape
21   exit 2
22 else
23   echo delicious-API
24   exit 3
25 fi
26
27 echo unknown format
28 exit 4
29
Note: See TracBrowser for help on using the browser.