Converting sLoPPy cASE to Pretty Case with tr
I need a quick one-liner for an assignment to convert strings of any type (including uGLY sTuFF lIKE thiS) into strings like these (Doesnt This Look A Lot Nicer?)
I also have to convert AnY CasE to UPPER CASE, but that one was easy (echo str | tr [:lower:] [:upper:]) but I can't figure out how to get the first character to convert and not the whole string. I could do some substringing, but dont really want to if I dont have to (btw this is in bash...) |
Since it's an assignment question I suggest you research
the possibilities using google and experiments ... Asking Homework questions is against the RULES Cheers, Tink |
Its a huge assignment, I'm asking for literally 1/3 of a one-liner. I have my textbook out and I've searched google like 19 times. Its pretty trivial for anyone who knows how to do it. I'm just not a fan of wasting insane amounts of time on a something trivial like this while I have other assignments in assembly, c++ and web programming. I fully understand the reason for the rules, but if I didnt mutter the words 'for my assignment' nobody would have known and I would have got the answer. At least i'm being honest. If it was for a project at work would that be OK? Please explain the difference. I understand "its for my own good" and all that, but I need to finish MANY assignments in the next 2 days so I can GO HOME and see my family instead of wasting time fidgeting with tr in Linux.
Code:
echo "str" | tr [:upper:] [:lower:] | MY QUESTION Thanks for understanding. BTW I still haven't got it yet and would still appreciate an answer. My head is spinning from lack of cigarettes (quit last week) and too much programming. Please understand. Thanks. |
C'mon kiddo, don't get lippy with me. You've signed up and
agreed to the rules, and that's the end of the discussion. Cheers, Tink |
fine
|
All times are GMT -5. The time now is 12:14 AM. |