FG

How do the '-s', '-t', and '-c' options of the tr command work in Unix?

Fresh3 days ago
Mar 15, 202622531 views
Confidence Score0%
0%

Problem

I am confused regarding the way , , and options work in the tr command. When I do I get the output: This is quite understandable, since is repeated in . The last possible change in place of is , and hence the output. Now when I do the output is The option is supposed to squeeze every repeated occur…

Error Output

echo I am a good boy | tr good bad

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How do the '-s', '-t', and '-c' options of the tr command work in Unix?

Low Risk

Switch: Squeeze (remove repeated characters) output: There are two things happening behind the scenes that make this happen. Firstly, if the second argument to is shorter than the first then the last character in the 2nd arg is repeated to make it t…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment