본문 바로가기

스크립트

[스크립트] jq 패키지 설치하는 스크립트

반응형

jq 패키지 설치하는 스크립트

jqinstall.sh 스크립트 작성

vim jq-install.sh
#!/bin/bash

# Check if jq is already installed
if command -v jq &> /dev/null; then
  echo "jq is already installed."
else
  # Check package manager and install jq
  if command -v apt-get &> /dev/null; then
    sudo apt-get update
    sudo apt-get install -y jq
  elif command -v yum &> /dev/null; then
    sudo yum update
    sudo yum install -y jq
  else
    echo "Unable to determine package manager. Please install jq manually."
    exit 1
  fi
fi
chmod +x jq-install.sh

 

참고URL

- jq 명령어 : https://scbyun.com/782

 

728x90
반응형