Shell script input trick

In the occasion where you are not sure how long the user input might be and you want to capture it all, you would use $@ instead. In the following example, I took in the entire string and print it out word by word after breaking them into a string array according to the spaces in between.

In script run_this.sh:

userInputs=($@)
for i in "${userInputs[@]}";; do
  echo "$i"
done

Running the command:

./run_this.sh who knows how long this can go
who
knows
how
long
this
can
go



source: https://medium.freecodecamp.org/functional-and-flexible-shell-scripting-tricks-a2d693be2dd4


Updatable objects appear as 'no longer supported'

  Symptoms In some scenarios, the following validation warning appears on an updatable object: " Object is no longer supported. Enforci...

Mais vistos