Bash code to print all folders:
for f in ~/*; do if [ $f == '/home/sk/.' -o $f == '/home/sk/..' ]; then true else echo "$f" fi done
It works on bash. When i ran the code on z shell, it threw error:
= not found
Then I converted
]] to avoid this error in z shell and ran it on z shell. It threw next error:
condition expected: $f
]], bash also throws error as:
syntax error in conditional expression syntax error near `-o'
Is there a POSIX standard to do string comparison in shell, that works across shells?