-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmidterm.sh
More file actions
132 lines (74 loc) · 1.67 KB
/
midterm.sh
File metadata and controls
132 lines (74 loc) · 1.67 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
echo Welcome to my midterm Script what is your name?
read MY_name
echo "Hello, $MY_name this is my script that does random things and trys to use all bash conmmads in the book"
ls
echo current displayed dir
pwd
cd /home
mkdir Script
touch midterm.txt
free -m
cat midterm.txt
df -h
jobs
echo "Hello $MY_NAME - hope you're well."
echo "whats does it feel like out side"
read MY_weather
echo "$MY_weather -,That's to bad heres the temperture"
URL='https://www.accuweather.com/en/us/st-paul-mn/55102/weather-forecast/348795'
wget -q -O- "$URL" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $2": "$16", "$12"°" }'| head -1
echo "$MY_name have a great day"
cat cd /home/atom/Desktop >Weather.txt
if [ $# -lt 1 ]
then
echo "Usage: $0 file ..."
exit 1
fi
echo "$0 shows the lines of code"
l=0
n=0
s=0
for f in $*
do
if [ -0 $f] # checks whether file owner is running the script
then
l='wc -l $f | sed 's/^\([0-9]*\).*$/\1/'`
echo "$f: $1"
n=$[ $n + 1]
s=$[ $s + $1]
else
continue fi
done
echo "$n files in total, with $s lines in total"
ls -l
cp midterm.txt
mv midterm.txt ... midterm.txt dir
echo making a new file
touch file
ls -l file
echo whats the file
echo good by file
rm file
echo we just made a file and removed it yay!!!!
touch atext1.txt
touch btext2.txt
touch ctext3.txt
touch etext4.txt
touch ftext5.txt
touch gtext6.txt
touch ktext7.txt
touch ltext8.txt
echo just made ten files lets sort them around
sort -n
echo $PATH
echo alright $MY_name Lets take a look at your cpu type
head /proc/cpuinfo
head /proc/cpuinfo | tr a-z A-Z
ls /fffffffff > f
echo every thing running
ps x
ps ax
ps u
ps w
echo blah blah > /dev/null