The simple code here is working as expected on my machine if launched with bash
:
function ⏰(){
date
}
⏰
Could there be a problem for other people using this, or is it universal ?
I'm wondering because I've never seen anything like this in other source code for now.
Edit : There are unlimited possibilities, it can be used to quickly distinguish a function role with the usage of an emoji for example.
A 💣 for something that can modify or remove files, a 🔧 if it's a work in progress, 📃 for an interactive menu...
I guess we should create a standard for all of that, but it seems to be an interesting idea.
Maybe a random line of ~5 characters can help us a lot understanding what the code is doing. (Of course we need to learn how to read them.)
More edit : I'm giving it a shot. For now, if i fold all my functions in my editor (Or cat myscript.sh|grep function
) they look like this. (My unicode looks much better in geany
or my terminal compared to here.)
function ⬚_1(){
function ⬚⬚_2(){
function ⬚⬚⬚_📃_D(){
function ⬚⬚⬚⬚_📃_X(){
function ⬚⬚⬚⬚⬚_📃_Y(){
function ⬚⬚⬚⬚⬚⬚_❓_P(){
function ⬚⬚⬚⬚_📃_Z(){
function ⬚⬚⬚⬚⬚_❓_U(){
function ⬚⬚⬚⬚⬚_❓_O(){
I use a strange indentation ⬚ to show how the functions are related to each other and a symbol 📃/❓ to clearly distinguish their role. (Of course these are not my real function names, I just put a random letter at the end, but even without them we can clearly see the relationships.)
echo $foo
is safe.