Expand|Select|Wrap|Line Numbers
- #!/bin/bash
- farr0=("#####" " #" "#####" "#####" "# #" "#####" "# " "#####" "#####" "#####" " #" " ")
- farr1=("# #" " #" " #" " #" "# #" "# " "# " " #" "# #" "# #" " # " " # ")
- farr2=("# #" " #" "#####" "#####" "#####" "#####" "#####" " #" "#####" "#####" " # " " ")
- farr3=("# #" " #" "# " " #" " #" " #" "# #" " #" "# #" " #" " # " " # ")
- farr4=("#####" " #" "#####" "#####" " #" "#####" "#####" " #" "#####" " #" "# " " ")
- function print_datetime {
- datetime=`date '+%Y%m%d%H%M%S'`
- for i in {0..4}
- do
- # What I'd like: (example for year only)
- # echo -n ${farr{$i}[$datetime[0]]}
- # echo -n ${farr{$i}[$datetime[1]]}
- # echo -n ${farr{$i}[$datetime[2]]}
- # echo -n ${farr{$i}[$datetime[3]]}
- done
- }
- print_datetime
Expand|Select|Wrap|Line Numbers
- ##### ##### # #####
- # # # # #
- ##### # # # #####
- # # # # #
- ##### ##### # #####
Don't get me wrong, I can do this, and have done so using both awk and C, so regardless I have a solution, but I would really like to know where I'm going wrong.
I know I haven't provided much in term of example code, but the reason is simply that nothing really works. It's not just a matter of syntax error or similar, it's me doing something fundamentally wrong.
Anyway, if you have something to add, I'd like to hear it. I know it isn't really a question as such, but here goes anyway.
Best regards.