Bash - Determine if I should 'work', 'play' or 'sleep'

should_i_work(){ you="\nYou should "; current_hour=$(date "+%H"); if [ $current_hour -ge '08' ]; then if [ $current_hour -le '17' ]; then echo -e $you'work'; else echo -e $you'play'; fi else echo -e $you'sleep'; fi; }; should_i_work;

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.