source: trunk/oar/oar-envsh @ 20

Last change on this file since 20 was 20, checked in by g7moreau, 12 years ago
  • Small bug with space
File size: 890 bytes
Line 
1#!/bin/bash
2#
3# This wrapper try to remove system's unmodified environment variables
4# and propagate user environments on the nodes.
5#
6# This script is licence under the same licence as OAR program
7#  GNU GENERAL PUBLIC LICENSE
8#  http://oar.imag.fr/
9#
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!)
12# 1.2 Gabriel Moreau (format, small bug and licence)
13#
14
15HOST=$1
16shift
17
18MYENV=$( env \
19   | grep "^[ABCDEFGHIJKLMNOPQRSTUVWXYZ]" \
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=" \
25   | sort \
26   | sed -e 's/^/export /; s/=/="/; s/$/"/' \
27   | tr [\\\n] [\;] )
28
29exec /opt/oar/current/bin/oarsh $HOST "$MYENV $@"
Note: See TracBrowser for help on using the repository browser.