• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Search

required

Check if Multiple Arguments

August 16, 2023

If your Bash script calls for 3 arguments, here’s how to check it.

if [ "$#" -ne 3 ]
then
  echo "Usage: ./script.sh project diskname policy"
  exit
fi

if [ "$#" -ne 3 ] then echo "Usage: ./script.sh project diskname policy" exit fi

You can adjust -ne 3 to any number based on the number of required arguments.

Filed Under: Linux Tagged With: arguments, bash, required, usage

Ubuntu Check Reboot Required

July 17, 2021

Check if reboot is required in Ubuntu.

at /var/run/reboot-required
*** System restart required ***

at /var/run/reboot-required *** System restart required ***

Filed Under: Linux Tagged With: reboot, required, ubuntu

  • Home
  • About
  • Search

Copyright © 2023