bash : Bad Substitution
#!/bin/bash jobname=”job_201312161447_0003″ jobname_pre=${jobname:0:16} jobname_post=${jobname:17} This bash script gives me Bad substitution error on ubuntu. Any help will be highly appreciated. 13 Answers 13
#!/bin/bash jobname=”job_201312161447_0003″ jobname_pre=${jobname:0:16} jobname_post=${jobname:17} This bash script gives me Bad substitution error on ubuntu. Any help will be highly appreciated. 13 Answers 13
This question already has answers here: How to replace all occurrences of a string in JavaScript (79 answers) Closed 7 years ago. I have a string with multiple commas, and the string replace method will only change the first one: var mystring = “this,is,a,test” mystring.replace(“,”,”newchar”, -1) Result: “thisnewcharis,a,test” The documentation indicates that the default replaces … Read more
This question already has answers here: Is there a simple way to remove multiple spaces in a string? (24 answers) Closed 7 years ago. I have this string: mystring = ‘Here is some text I wrote ‘ How can I substitute the double, triple (…) whitespace chracters with a single space, so that I get: … Read more