Commit ab680b8d authored by vagrant's avatar vagrant

questions 1 - 4 finished, working on 5

parent 21e06021
#!/bin/bash
awk -F, '{ print "insert into my fruits (code,name,color) values ( "$1",\""$2"\",\""$3"\")" }' sample.txt
#!/bin/bash
declare -a arrayOne
declare -a arrayTwo
arrayOne=($(awk -F: '{ print $1 }' /etc/passwd))
arrayTwo=($(awk -F: '{ print $6 }' /etc/passwd))
for i in "${arrayOne[@]}"
do
echo $i
done
for val in "${arrayOne[@]}"
do
if [ $val == $1 ]; then
echo "${arrayTwo[$val]}"
break
else
echo "User "\""$1"\"" not found"
break
fi
done
echo ${arrayOne[@]}
echo ${arrayOne[2]}
#!/bin/bash
for FILE in ${@}
do
if [[ -f $FILE ]]
then
echo ${FILE^^}
else
echo "File ${FILE} does not exist"
fi
done
#!/bin/bash
seq -f "Number is : %g" 1 2 50
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