Hi,
thanks.
I tired the command with "echo -e"....
this is working fine.
the Result of the command I write in a file to show the user a message, if passwd raises an error....
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
function user_passwd(lo_alt, lo_neu)
define lo_alt string,
lo_neu string,
lo_ch base.Channel,
lo_stm string,
lo_result string,
lo_logdatei string,
lo_egal string,
lo_pw_geaendert boolean,
lo_errorlevel string
-- ! | ? & % " ' \ sind nicht erlaubt!
let lo_alt = lo_alt clipped
let lo_neu = lo_neu clipped
let lo_pw_geaendert = false
let lo_errorlevel = ""
let lo_logdatei = vlogin clipped, "_passwd.log"
let lo_logdatei = lo_logdatei clipped
let lo_egal = os.path.delete(lo_logdatei)
let lo_stm = "echo -e '", lo_alt, "\\n", lo_neu, "\\n", lo_neu, "' | passwd 1>>", lo_logdatei, " 2>> ", lo_logdatei
run lo_stm returning lo_errorlevel
if lo_errorlevel = 0 then
let lo_pw_geaendert = true
else
let lo_pw_geaendert = false
end if
let lo_ch = base.channel.create()
call lo_ch.openFile(lo_logdatei, "r")
call lo_ch.setdelimiter("")
while lo_ch.read ([lo_result])
if lo_result matches "*Ändern des Passworts*" then
continue while
end if
if lo_result matches "*Ändern Passwort*" then
continue while
end if
display lo_result
end while
call lo_ch.close()
let lo_egal = os.path.delete(lo_logdatei)
if lo_pw_geaendert = true then
display "hat geklappt!!!!!"
else
display "hat NICHT geklappt!!!!!"
end if
end function
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------