Your shell could not find ls, et al, because they weren't installed. To repeat:
Quote:
Originally Posted by Corona688
Lesson #2: BASH is a shell. It excels at calling other programs but most things you use in it, like cp mv ls awk sed cut, are not built into it. (busybox is a huge exception here -- it DOES have all of these and hundreds more built in for your convenience.) Things you can expect to be builtins include echo, printf, and test.
If you want all these commands without having to install them, I suggest busybox again...
As for your program, you should not be using
long long int unless you actually need a
long long int. It is a 64-bit number -- printf %d expects a 32-bit one.
The %d reads the first 32-bits of your 64-bit number. The %s reads the other half as all-zeroes since it is all-zeroes, which becomes (NULL) when printed. The string itself never gets used.