Commit bfcec0f6 authored by Xiyang Lu's avatar Xiyang Lu

finish 1,3,4, still working on 2 and 5

parent 8bf2302c
File added
#!/bin/bash
declare -i totalhours=0
while read LINE
do
billFlag=$(echo $LINE | awk -F, '{print $7}')
hours=$(echo $LINE | awk -F, '{print $8}')
[[ $billFlag == "Y" ]] && totalhours=$(( $totalhours + $hours )) && echo $LINE | awk -F, '{print $3}' | sort -k3 | uniq -c
done < timesheet.csv
echo "Total hours $totalhours"
#StartDate,EndDate,Name,Email,Customer,Country,Billibility,Hours
\ No newline at end of file
#!/bin/bash
seq -f "Number is : %g" 1 2 50
#!/bin/bash
file='sample.txt'
while IFS=, read -r code name color; do
echo "insert into myfruits (code,name,color) values (\"$code, $name, $color\")"
done < <(grep "" $file)
#!/bin/bash
for file in ${@}
do
if test -f "$file";
then
echo ${file} | tr [:lower:] [:upper:]
else
echo "not found"
fi
done
#!/bin/bash
declare -a arr
arr=($(awk -F: '{ print $1 }' /etc/passwd))
for val in ${arr[@]}
do
if [ $1 == $val ]; then
echo "equal"
break
fi
done
1,Apple,Color is Red
2,Mango,Color is Orange
3,Banana,Color is Yellow
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment