// you’re reading...

Software Development

Korn Shell Scripting Tutorial

Just noting the link to a concise ksh tutorial that I came across. A more complete list of shell scripting notes is available here. Some additional notes :

Including other scripts: For better code/script organization if one wants to include a one script (say, include_script.ksh) in another script (say, main_script.ksh) following line in “main_script.ksh” will achieve it: . full_path/include_script.ksh Note the “.”, without this “include_script.ksh” will get executed in a separte shell and its variable will not be visible in “main_script.ksh”.

Variables Significant to ksh and sh: There is a good list here

Redirecting: All Unix process have 3 file descriptors by default 1 (stdout), 2 (stderr) and 3 (stdin). Following example shows how to redirect both stdout and stderr to same file:

ls -l > my_file 2>&1

(For more details see file duping section here)

Discussion

No comments for “Korn Shell Scripting Tutorial”

Post a comment