|First, let's talk about the od -bc command:|
The od command counts the number of characters with "0000000" being the start. Consider the contents of file ff:
Now, execute od on the file:
od -bc ff
0000000 061 062 063 064 065 066 067 012
1 2 3 4 5 6 7 \n
eight characters are displaying - 7 numbers and a newline. Add characters to the file and see how the last number increases.
Second, concerning executing with sh command, I mislead you. If you execute a script with a leading sh such as this:
It runs the script as a bourne shell no matter what is in line 1. Suppose script ab.ss contains this:
v2=$(eval echo $a$cnt)
# end script
explicitly overrides #!/bin/ksh and the script fails with a syntax error.
What #!/bin/ksh allows you to the script to override the current shell that executed the script. Here is how to emulate it:
From your command line, execute:
Your shell is now the bourne shell (although the parent that executed it might be the korn or the bash shell).
Now, execute ab.ss and it should run with no failures.
Let me know if you have any questions or comments.