-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathus.sh
More file actions
74 lines (66 loc) · 1.52 KB
/
us.sh
File metadata and controls
74 lines (66 loc) · 1.52 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
COLUMNS=80
select choice in \
"View Contents of JAR" \
"Show all environment variables" \
"Add an env avriable to profile" \
"Add path to path variable" \
"Search for a resource in jar files" \
"Quick search for a resource in jar files" \
"Who uses port xy?" \
"Find file in directory" \
"Quit"
do
case $REPLY in
1)
ls -l
echo "Name of jar file"
read jarname
jar tf $jarname
break
;;
2)
env
break
;;
3)
vim ~/.bash_profile
break
;;
4)
echo "Add the path to add"
read npath
export PATH=$PATH:$npath
break
;;
5)
echo "Enter file name:"
read fname
cm="jar tf {} | grep $fname && echo {}"
eval find * -type f -name '*.jar' -print0 | xargs -0 -I '{}' sh -c "$cm"
break
;;
6)
echo "Enter file name:"
read fname
eval find * -name "*.jar" | xargs grep $fname
break
;;
7)
echo "Enter port:"
read portno
lsof -n -i:$portno | grep LISTEN
break
;;
8)
echo "Search pattern:"
read pattern
find . -iname "$pattern"
break
;;
9)
break
;;
esac
break #stops From Re-Looping After Chooseing
done