source: trunk/oar/oar-envsh @ 28

Last change on this file since 28 was 20, checked in by g7moreau, 12 years ago
  • Small bug with space
File size: 890 bytes
RevLine 
[16]1#!/bin/bash
2#
[18]3# This wrapper try to remove system's unmodified environment variables
4# and propagate user environments on the nodes.
[16]5#
[18]6# This script is licence under the same licence as OAR program
7#  GNU GENERAL PUBLIC LICENSE
8#  http://oar.imag.fr/
[16]9#
[18]10# 1.0 Nicolas Capit  (initial version for PATH and LD_LIBRARY_PATH)
11# 1.1 Patrick Begou  (all the environment excepted... that could make problems!)
[20]12# 1.2 Gabriel Moreau (format, small bug and licence)
[18]13#
[16]14
15HOST=$1
16shift
17
18MYENV=$( env \
19   | grep "^[ABCDEFGHIJKLMNOPQRSTUVWXYZ]" \
[18]20   | egrep -v "^USER=|^TERM=|^OAR|^SGE_|^LS_COLORS=\
21      |^ENV=|^BASH_ENV=|^HOSTNAME=|^LOGNAME=|^MAIL=\
22      |^MANPATH=|^OMPI_MCA_plm_rsh_agent=|^PWD=\
23      |^SHELL=|^SSH_|^SUDO_COMMAND=|^HOME=|^DISPLAY=\
24      |^SHLVL=" \
[16]25   | sort \
[20]26   | sed -e 's/^/export /; s/=/="/; s/$/"/' \
[16]27   | tr [\\\n] [\;] )
28
29exec /opt/oar/current/bin/oarsh $HOST "$MYENV $@"
Note: See TracBrowser for help on using the repository browser.