-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnanolauncher.sh
More file actions
43 lines (38 loc) · 1.05 KB
/
Copy pathnanolauncher.sh
File metadata and controls
43 lines (38 loc) · 1.05 KB
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
#!/bin/bash
NANO="/usr/bin/nano"
for PARAM; do
if [[ -f $PARAM ]]; then
[[ ! $NANOFILE ]] && NANOFILE="${PARAM}" || exec $NANO "$@"
fi
done
case `file -b "${NANOFILE}"` in
*perl*"script text"* )
SYNTAX="--syntax perl"
;;
*python*"script text"* )
SYNTAX="--syntax python"
;;
*ruby*"script text"* )
SYNTAX="--syntax ruby"
;;
*PHP*"script text"* )
SYNTAX="--syntax php"
;;
*"script text"* )
SYNTAX="--syntax sh"
;;
*"diff output text"* )
SYNTAX="--syntax patch"
;;
*C*"program text"*)
SYNTAX="--syntax c"
;;
*"Java program text"* )
SYNTAX="--syntax java"
;;
*"HTML document text"* )
SYNTAX="--syntax html"
;;
esac
exec $NANO ${SYNTAX} "$@"
exit