Anyone know how to represent a tab in a shell string or variable and make it *explicit* to someone reading the code that there is a tab in there?

My script has the following line:
grep -l "Module name: ${module}"

Can't be represented in here, but in the code that space is actually a tab.

I also do similar in a line like this:

split -a 3 -p "CVSROOT: /cvs"

Again, the space here is a tab in the script.

Thoughts?

Follow

@kurtm
This whole thread is a sizable chunk of why I hate shell scripting. 🙄

Seriously, I've gone so far as writing "scripts" in Rust, C, and even Java just to avoid the flaws in shell languages.

I know, I know. Python is an option too... But something about its syntax throws me for a loop. I'm going to have to tackle that some day.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!