Ad
Code
Diff
  • #!/bin/bash
    
    [ $# -eq 1 ] && echo "$(dirname $1), $(basename ${1%.*}), ${1##*.}"
    • #!/bin/bash
    • if [ $# -eq 1 ]; then
    • echo "$(dirname $1), $(basename ${1%.*}), ${1##*.}"
    • fi
    • [ $# -eq 1 ] && echo "$(dirname $1), $(basename ${1%.*}), ${1##*.}"
Code
Diff
  • #!/bin/bash
    
    echo Hello Bash!
    
    [ $# -ne 0 ] && echo "Hello, $1!" || echo "No parameters found."
    • #!/bin/bash
    • echo Hello Bash!
    • if [ $# -ne 0 ]; then
    • echo "Hello, $1!"
    • else
    • echo "No parameters found."
    • fi
    • [ $# -ne 0 ] && echo "Hello, $1!" || echo "No parameters found."