Skip to main content

Questions tagged [tr]

For questions pertaining to tr, a utility that translates or deletes characters. Use this tag for questions about the tr utility itself, or questions about issues arising from its use.

-1 votes
1 answer
85 views

root@calleva:~# echo "f" > file root@calleva:~# f=$(<file) root@calleva:~# echo "$f" f root@calleva:~# echo "$f" | tr -c '[:alpha:]' '_' f_root@calleva:~# echo &...
Richard Barraclough's user avatar
2 votes
0 answers
115 views

The first command below produces each number on a separate line, and I would expect the second command to do the same thing because the only difference between the two is that we are using echo '1 2 3'...
sudocracy's user avatar
  • 231
5 votes
1 answer
447 views

I wanted to use tr to substitute "illegal" characters in a string with a replacement character, where "illegal" characters are all outside of a set of "allowed" ...
AdminBee's user avatar
  • 23.6k
0 votes
1 answer
232 views

I want to use the tr command to rename something like filename.ext to someName.ext. To do that I've tried echo "filename.ext" | tr -c ".a-z" "someName"` to replace the ...
Abhishek A Udupa's user avatar
0 votes
5 answers
863 views

I have a file containing the below pattern, up to 2000 lines. For every group of three lines, the pattern repeats with different numerical values, but text values at the beginning are common up to ...
C S Pallapu's user avatar
0 votes
0 answers
38 views

I'm able to fill 1MB file with specific character like this: > tr '\0' '#' </dev/zero | dd of=1MB.bin bs=1k count=1024 1024+0 records in 1024+0 records out 1048576 bytes (1.0 MB, 1.0 MiB) copied,...
ardabro's user avatar
  • 159
3 votes
2 answers
751 views

I'm running macOS 12.3.1 I added a couple of lines to my .zshrc, viz. export GREP_OPTIONS='--color=always' export GREP_COLOR='1;35;40' After this, when I pipe grep output to tr, it returns the same ...
Shriram's user avatar
  • 226
2 votes
1 answer
229 views

I have a string called "desktops" that look like this: desktops="1 2 %{F#990000}3%{F-} 4 5 6 7 8 9 0" The 6 digits after the "#" represent an RGB color, so the 3rd ...
ElTitoFranki's user avatar

15 30 50 per page
1
2 3 4 5
13