¿Cómo puedo hacer que xterm ejecute mi archivo .login cuando se abre?

-1

El título lo dice todo. Estoy ejecutando Yosemite 10.10.3 con XQuartz 2.7.7. ¡Gracias por la ayuda! Expandido: cuando se abre un nuevo terminal (por ejemplo, un terminal o un elemento, que uso principalmente), se ejecuta el archivo ~ / .login. Esto configura las variables de entorno, etc., que uso. Cuando xterm se abre, no se ejecuta ~ / .login, así que tengo que buscarlo antes de comenzar cualquier trabajo. Hasta ahora tan bueno. Obviamente, si puedo ejecutar el archivo .login cuando se abre el xterm, ahorraría un poco de tiempo. El problema es cuando genera un comando para ejecutar un comando de shell que se define en el archivo .login. Esto no funciona si el archivo .login no se ejecuta cuando se abre el shell. Esto es doloroso. He intentado crear un archivo .xinitrc, pero parece que funciona al 100%. Necesito algo mejor. Por supuesto, si fuera una persona real de Unix, probablemente lo sabría, pero ...

Estoy usando tsch. por cierto: si .login es el archivo incorrecto, me complace hacer el trabajo de alguna otra manera que funcione.

    
pregunta Ross Smith 10.05.2015 - 23:08

2 respuestas

1

Desde man xterm :

-ls This option indicates that the shell that is started in the xterm 
    window will be a login shell (i.e., the first character of argv[0] will be a dash, 
    indicating to the shell that it should read the user's .login or .profile).

Desde man tcsh :

A login shell begins by executing commands from the system files /etc/csh.cshrc
and /etc/csh.login. It then executes commands from files in the user's home directory:
first ~/.tcshrc (+) or, if ~/.tcshrc is not found, ~/.cshrc, then ~/.history (or the
value of the histfile shell variable), then ~/.login, and finally ~/.cshdirs (or the
value of the dirsfile shell variable) (+). The shell may read /etc/csh.login before 
instead of after /etc/csh.cshrc, and ~/.login before instead of after ~/.tcshrc or 
~/.cshrc and ~/.history, if so compiled; see the version shell variable. (+)

Non-login shells read only /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc on startup.

Entonces, en su caso, puede asegurarse de que xterm se llame como xterm -ls (para que actúe como shell de inicio de sesión) o cambiar el nombre de .login a .cshrc (o .tcshrc ).

    
respondido por el nohillside 12.05.2015 - 14:16
0

Tuve exactamente el mismo problema, que apareció después de actualizar a la última versión de Mac OSX. Al abrir un nuevo terminal se generó un error, a saber, 'Si: sintaxis de expresión', y no se ejecutó .login.

Solución: elimine el archivo /etc/csh.login, o inspecciónelo para ver si contiene una declaración ofensiva (en mi caso, una línea que ejecuta un script asociado con el paquete mdsplus).

Espero que ayude

    
respondido por el bvm 13.07.2018 - 14:54

Lea otras preguntas en las etiquetas