I have a certain command right now
$(sed $((SS - default_scripts))!d customScripts.txt)
and it gives me Foo Bar
, I want to convert this to lowercase but when I tried using the | awk '{print tolower($0)}'
command on it, making it look like this
$($(sed $((SS - default_scripts))!d customScripts.txt) | awk '{print tolower($0)}')
yet this returns nothing, maybe the awk
method of converting it to lowercase is not valid or correct.
So please enlighten me on my typo, or recommend me another POSIX way of converting a whole string to lowercase in a compact manner. Thank you!
CodePudding user response:
The pipe to awk should be inside the same command substitution as sed
, so that it processes the output of sed
.
$(sed $((SS - default_scripts))!d customScripts.txt | awk '{print tolower($0)}')
You don't need another command substitution around both of them.