|
CS469/569 - Linux and Unix Administration and Networking
Spring 2022
|
Displaying ./code/02-15/weather.sh
#!/bin/bash
p="/u1/junk/kinne/weather/Terre_Haute_airport_93823-03868.csv"
#head $p
#tail $p
echo "High precip."
sort -k 2 -n -r -t "," "$p" | head
echo ""
echo "High temp"
sort -k 5 -n -r -t "," "$p" | head
echo ""
# total precip for a year?
# grep 2010 -> just 2010 lines
# isolation the precip??
echo "Precip for 2010"
#grep "2010-" "$p" | head | colrm 1 11
grep "2010-" "$p" | head | cut -d "," -f 2 | grep -v "T"
# add up those values??
#users | tr " " "\n" | sort -u | uniq
echo "How frequent each temp?"
sort -k 5 -n -r -t "," "$p" | cut -d "," -f 5 | uniq -c
echo ""
d="/u1/junk/kinne"
#ls "$d"
env -i PATH="$d" HOME="$d" ls # why didn't it find ls?
env -i HOME="$d" ./print_home.sh # why didn't it find ls?
|