0

From the korn shell, I keep getting print command not found. When I run print from the shell, it says the same thing. How would I go about fixing this? printf works fine, but for some reason print is not.

This is redhat 5.5 and the ksh is 3.2.25-release.

Thanks

  • 3
    Are you sure the print command does what you think it does? On my Debian system, it's a symlink to run-mailcap from the mime-support package. – jordanm Oct 8 '12 at 17:50
0

Could we have a little more information, please? "print" is a shell built-in function for ksh, and it should always be there. Here's some information from my own redhat system:

$ cat /etc/redhat\-release 
Red Hat Enterprise Linux Workstation release 6.3 (Santiago)

$ /bin/ksh --version
version         sh (AT&T Research) 93t+ 2010-06-21

$ whence -v print
print is a shell builtin

You might also check to see that you have no aliases named "print". I don't have any executables named "print" in /usr/bin, or /bin, etc. You might check whether that is also true for you. Start a new instance of the shell (type "/bin/ksh") and then say

PATH= whence -v print
  • it is "GNU bash, version 3.2.5(1)-release (x86_64-redhat-linux-gnu)", I just noticed it says GNU bash. It looks like some how it created a symlink to that. Not sure why. – Matt Oct 8 '12 at 20:35
0

There's no such version of ksh. This is the version of bash on RHEL 5.5, however, so it looks like you're using bash. Are you looking for the ksh builtin? Use echo or printf instead. Or run ksh (which might not be installed, bash is the de facto standard shell on non-embedded Linux installations).

Here's a guide to translation print options to POSIX-compliant printf.

  • No option or -e: printf '%b\n'
  • With -n: omit \n from the format (printf %b or printf %s)
  • -p: if you need coprocesses, you need ksh
  • With -r or -R: printf '%s\n'
  • -s: redirect to the desired output file explicitly, with >> for appending
  • -u: use redirection, e.g. printf … >&3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.