null_reflections
Legendary Coder
As a novice programmer, I would think that this would put a password into the "su" command in linux and then validate the password:
However, i've tried many variations of this (even using printf) and for some reason at best the password prints on the screen and then su asks me for the password again. I just thought it would be interesting to be able to automatically be superuser at startup, but unfortunately things are not always as straightforward as they seem! Doesn't piping mean converting one programs output into another program's input? I suppose i'd have to change "su" itself if I wanted this to work, does anyone know why?
echo <my-password> | su | echo However, i've tried many variations of this (even using printf) and for some reason at best the password prints on the screen and then su asks me for the password again. I just thought it would be interesting to be able to automatically be superuser at startup, but unfortunately things are not always as straightforward as they seem! Doesn't piping mean converting one programs output into another program's input? I suppose i'd have to change "su" itself if I wanted this to work, does anyone know why?