Войти
  • 4857Просмотров
  • 4 года назадОпубликованоNick Janetakis

Why You Should Put Braces around Your Variables When Shell Scripting

It's for consistency's sake, reducing confusing and using certain shell features. Hit the subscribe button to receive more videos like this! REFERENCE LINKS --------------------------------------------------- ► COURSES --------------------------------------------------- Courses I've created that focus on web dev and deployment topics. ► THE TOOLS I USE / GEAR --------------------------------------------------- ► FOLLOW ME ELSEWHERE --------------------------------------------------- ► Twitter: ► GitHub: TIMESTAMPS --------------------------------------------------- 0:00 -- Intro 0:07 -- Quoting your variables is important too 0:44 -- Taking a look at an example script that demos a few use cases 0:54 -- Defining a default value 1:46 -- Help visualize what is part of a variable or a string 2:12 -- Clearly separating variables when an underscore is involved 3:04 -- Truncating a variable's output in Bash 3:59 -- Reference a specific index in an array 4:45 -- Being able to reference more than 9 command line arguments 5:39 -- Shellcheck will call out when you're not using braces