Thank you for your donation!


Radio stations
#21
@duracell80

Spaces are legal in a Linux filename, as you can see in the .pls files distributed with moOde. Having said that, I find them to be a PITA when working from the command line because I keep forgetting to quote the filename.

There's no such thing as the right way to do this Smile I'd probably write a sed command which strips out punctuation (except what we call "period" in the USA and most others call "full stop", since folks tend to expect a frequency like "100.1", not "100_1") and, if desired, substitute underline for space.

Regards,
Kent
Reply
#22
A simple method would be to use tr, for example;

Code:
echo 'A  s:t&r-i.N"g   123' | tr -d [:punct:] | tr -s [:space:] _ | tr [:upper:] [:lower:]

a_string_123
Reply


Forum Jump: