TONG-H

shell

651Notesshell2025-02-162025-02-23
  • write a shell script with multiple line

    1
    2
    - |-
    if [ "$ENV" == "pro" ]; then
  • cancel a job

    1
    exit 1
  • [ -z "$Base_Ref" ] -z: Tests if the variable is empty or undefined.

  • echo "VAR2=$VAR2" >> variables.txt: > Redirects output, overwriting the file if it exists.

  • >> Redirects output and appends it to the file, preserving existing content.