|
@@ -2211,6 +2211,30 @@ if {[string equal -nocase $user $read_user]} {
|
|
|
file rename -force $temp $black(alias_file)
|
|
file rename -force $temp $black(alias_file)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+proc alias:change:update {user newuser} {
|
|
|
|
|
+ global black
|
|
|
|
|
+ set file [open $black(alias_file) "r"]
|
|
|
|
|
+ set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}]
|
|
|
|
|
+ set temp "$black(tempdir)/alias_temp.$timestamp"
|
|
|
|
|
+ set tempwrite [open $temp w]
|
|
|
|
|
+ set arguments ""
|
|
|
|
|
+while {[gets $file line] != -1} {
|
|
|
|
|
+ set read_user [lindex [split $line] 0]
|
|
|
|
|
+if {[string equal -nocase $user $read_user]} {
|
|
|
|
|
+ set arguments [lrange [split $line] 1 end]
|
|
|
|
|
+ continue
|
|
|
|
|
+ } else {
|
|
|
|
|
+ puts $tempwrite $line
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+if {$arguments != ""} {
|
|
|
|
|
+ puts $tempwrite "$newuser $arguments"
|
|
|
|
|
+}
|
|
|
|
|
+ close $tempwrite
|
|
|
|
|
+ close $file
|
|
|
|
|
+ file rename -force $temp $black(alias_file)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
########################## Strip codes ###########################
|
|
########################## Strip codes ###########################
|
|
|
|
|
|
|
|
proc strip:all {str} {
|
|
proc strip:all {str} {
|