Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • Anyway to echo the result so it will be executed as a command? Or echo it to another variable? Commented Jan 27, 2020 at 7:51
  • Try $ ${var3//[\',]} Commented Jan 27, 2020 at 7:55
  • Yeah, oh, does that executes it as a command, I thought it only displayed the result (newbie as I wrote) Commented Jan 27, 2020 at 7:57
  • The result was: ./test1.sh: 22: ./test1.sh: Bad substitution and I exexuted: ./test1.sh 'kalle','damke','hekl' one interesting thing is that when I just echoed $var3 without your modification it seemed to strip the ' signs by it self: messer --command='m "Adam Larsson" testing kalle,damke,hekl ' Commented Jan 27, 2020 at 8:09
  • More context necessary. For me, it works (prints param count, and parameters): ${var3//[\',]} - CNT: 16, P1: Alf, P2: Complete, ALL: Alf Complete - S1E1 - Episode 1 has been paused hellfire i Engsub - Series testing] Commented Jan 27, 2020 at 8:28