0

I'm runing a bash script like this, with dev as an argument:

Here i print env and it shows dev

: '
role.dev=root
role.qa=user1
role.prod=user1
role=role.${env}
'

At this point role is empty

I never saw starting with colon and aposthrope and not sure how to work with it. I have to do it like this because there are some projects with this approach but it's not working in my case. Any idea?

Barmar
  • 741,623
  • 53
  • 500
  • 612
Julio
  • 429
  • 2
  • 16
  • Colon is just a command that doesn't do anything, and apostrophe is the string delimiter. There's nothing special about putting them together, they both do their normal thing. – Barmar Sep 25 '19 at 20:51
  • This is basically just commenting out all those lines of the script by putting them inside a string. – Barmar Sep 25 '19 at 20:52
  • Ok but which would be the reason to get role empty? – Julio Sep 25 '19 at 21:21
  • Because the assignment to `role` is commented out. – Barmar Sep 25 '19 at 21:26

0 Answers0