UnconnectedBedna / shrink-backup

A utility to backup SBC:s (like Raspberry pi) into minimal bootable img files
Other
48 stars 7 forks source link

Fixed typo #47

Closed framps closed 4 months ago

framps commented 4 months ago

I just detected there is a typo in the curl test :wink:

UnconnectedBedna commented 4 months ago

Ooops..

For consistency, could you change it to if [ $INSTALL_METHOD = 'curl' ]; then

framps commented 4 months ago

NP. I frankly use [[ ... ]]all the time in my bash code because I don't like the = operator. It's an assignment op for me and not a comparison op (I had a serious issue in my initial programming history because of this in C - used = instead of == :cry: ) .

There are other benefits you get from [[. Do you want me nevertheless to stick with = ?

UnconnectedBedna commented 4 months ago

I prefer to use double substitution (IIRC that's what it's called) only when needed, calculations for example.

In bash in substitution, = means EXACTLY, and == means "kinda", capital letters are accepted with == for example but not with =.

So yes, stick to that, there is a reason. :slightly_smiling_face: if [ $INSTALL_METHOD = 'curl' ]; then

framps commented 4 months ago

In bash in substitution, = means EXACTLY, and == means "kinda", capital letters are accepted with == for example but not with =.

That's new for me :astonished: Do you have any URL handy which explains this difference in detail?

Anyhow I will stick with = :smiley: