General question about the relationship between KSH and sed/grep/awk etc

Greetings all,

Unix rookie here, just diving into ksh scripting for the first time.

My question may seem confusing but please bear with me:

If I'm understanding everything I'm reading properly, it seems like the ksh language itself doesn't have a lot of string manipulation functions of its own - as a matter of fact all it really seems to have is variables, arrays, and control flow (i.e. loops, if/else/fi etc.)

Therefore, if one wants to write a ksh script to do, for example, extensive string manipulation, validation, reporting etc., one MUST make use of a utility like awk, or sed, or grep, or even something simple like cut to manipulate strings, and use something like command substitution to assign the return value to a variable, i.e.

sMyString1='hello,hi,what's up?'
sMyString2 = (echo $sMyString1 | cut -d',' -f2)

and then sMyString2 would be "hi"

I deviated from my original question a bit there.

Basically, I just want to make sure I'm understanding this correctly that ksh itself doesn't really have a great deal of built-in commands and functions and that you really do have to avail yourself of built-in (or downloaded/installed) unix programs and command substitution/redirection to do any complex programming.

Does it seem like I'm "getting it"?

Thanks buckets
DTXCF

Many common shells are different extensions on old-fashioned sh, which didn't even have arrays, so basic can mean really, really basic, and prevents really radical modification of the syntax. Efficiency's often aided by making some common things built-in -- it wouldn't have a builtin awk or sed, but would have a built in echo, read, etc. Creative use of things like the field seperator can also be used to help deal with strings but it's not a general-purpose do-everything construct. Though BASH has regexes these days...

Yes - you're getting it.

The shell is just a glue that holds everything else together with its own restricted functionality. As Unix is so efficient at parameter passing, STDIN, STDOUT etc and environment inheritance from parent to child process, there's no great reason to include string manipulation or even arithmetic in the shell when there are so many other good ways - sed, awk, perl - of doing things.

Unix scripting or even command line use is all about the toolkit and experience becomes a matter of choosing the right tool for the job at the time. This forum clearly shows, though, that there are many ways of using different tools to get the same end results.