I am a beginner in Scripting and I want to know the following differences in shell
- difference between
if [ condition ]; thenandif [[ condition ]]; then - I have this
var=$(diff file1.txt file2.txt)Why do i need to put$before the bracket? - When do I need to use
{}in shell? Why would I use it (except for arrays)? - Is there somewhere I can go to see the difference between
Linux shellandSolaris Shell? They aren't the same. I am trying to optimize a shell code with written in linux OpenSuse with shebang#!/bin/shfor solaris. However, I've notice that the code does not work on Solaris. However, it works perfectly in Linux. So I was wondering how or where can I read about it and optimize my code so it woks on Solaris as well.
thank you in advance