Bug 58

Summary: Clean File
Product: Sudo Reporter: paulorvj
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: normal    
Version: 1.6.4   
Hardware: HP   
OS: HP-UX   

Description paulorvj 2001-11-22 04:05:34 MST
The following command works correctly in AIX, where in root is owner, but in Hp-
ux the command doesn't work:

sudo echo "" > /file

The error is:  Ksh: Cannot create
Comment 1 Todd C. Miller 2001-11-22 08:51:59 MST
Redirection happens in the shell long before sudo is even executed.  That is why the error message is coming from ksh, _not_ sudo.  If what you want to do is truncate a file with sudo you can use something like 'cp /dev/null file'.