360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
(uname #f))
(if (null? (car uname-res))
"unknown"
(caar uname-res))))
(define (save-environment-as-files fname #!key (ignorevars (list "DISPLAY" "LS_COLORS" "XKEYSYMDB" "EDITOR")))
(let ((envvars (get-environment-variables))
(whitesp (regexp "[^a-zA-Z0-9_\\-:,.\\/%$]")))
(with-output-to-file (conc fname ".csh")
(lambda ()
(for-each (lambda (key)
(if (not (member key ignorevars))
(let* ((val (cdr key))
(sval (if (string-search whitesp val)(conc "\"" val "\"") val)))
(print "setenv " (car key) " " sval))))
|
|
|
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
(uname #f))
(if (null? (car uname-res))
"unknown"
(caar uname-res))))
(define (save-environment-as-files fname #!key (ignorevars (list "DISPLAY" "LS_COLORS" "XKEYSYMDB" "EDITOR")))
(let ((envvars (get-environment-variables))
(whitesp (regexp "[^a-zA-Z0-9_\\-:;,.\\/%$]")))
(with-output-to-file (conc fname ".csh")
(lambda ()
(for-each (lambda (key)
(if (not (member key ignorevars))
(let* ((val (cdr key))
(sval (if (string-search whitesp val)(conc "\"" val "\"") val)))
(print "setenv " (car key) " " sval))))
|