Shell脚本学习笔记

                                              Shell脚本学习笔记

 

#!/bin/bash
echo -e "\e[1;32mWork Overtime today !!!\e[0m";

printf "%-5s %-10s %-4s\n" No Name Mark
printf "%-5s %-10s %-4.2f\n" 1 Sarath 80.3456
printf "%-5s %-10s %-4.2f\n" 2 James 90.9989
printf "%-5s %-10s %-4.2f\n" 3 Jeff 77.564

fruit=apple;
count=5;
echo "We have $count ${fruit}(s)";
echo $LANG

no1=4;
no2=5;
let result=no1+no2;
echo $result;

cat<>log.txt
This is a message.
EOF

array_var=(a b c d);
echo ${array_var[1]};
idx=3;
echo ${array_var[$idx]};

 

你可能感兴趣的:(shell,Linux,栽树)