HackerTrans
トップ新着トレンドコメント過去質問紹介求人

databasher

no profile record

コメント

databasher
·2 年前·議論
With lines.txt:

  printf '(%s)\n' "one two" "three four five"
  echo "How you doin'?"
Running:

  while read -r line; do
    eval command=($line)
    command+=("arg with spaces" "other arg")
    "${command[@]}"
  done < lines.txt
Yields

  (one two)
  (three four five)
  (arg with spaces)
  (other arg)
  How you doin'? arg with spaces other arg
databasher
·2 年前·議論
Bash handles spaces just fine.

  # store the command in an array
  X=(echo "A B")
  # execute the command
  "${X[@]}"
Yields:

  A B
databasher
·2 年前·議論
Meanwhile, UPS's web site has mostly gone down. Their home page now reads "Sorry! We Can’t Find That Page. Looks like the page you’re trying to find may have been moved or deleted."