source: trunk/oar/oar-envsh @ 16

Last change on this file since 16 was 16, checked in by g7moreau, 12 years ago
  • oarsh with env variable
File size: 689 bytes
Line 
1#!/bin/bash
2#
3# This wrapper try to remove system's unmodified environment variables and propagate user environments on the nodes.
4#
5# version 1.0 by Nicolas Capit (initial version for PATH and LD_LIBRARY_PATH)
6# version 1.1 by Patrick Begou (All the environment excepted.... that could make problems!)
7#
8
9HOST=$1
10shift
11
12MYENV=$( env \
13   | grep "^[ABCDEFGHIJKLMNOPQRSTUVWXYZ]" \
14   | egrep -v "^USER=|^TERM=|^OAR|^SGE_|^LS_COLORS=|^ENV=|^BASH_ENV=|^HOSTNAME=|^LOGNAME=|^MAIL=|^MANPATH=|^OMPI_MCA_plm_rsh_agent=|^PWD=|^SHELL=|^SSH_|^SUDO_COMMAND=|^HOME=|^DISPLAY=|^SHLVL=" \
15   | sort \
16   | sed -e s"/^/export /" \
17   | tr [\\\n] [\;] )
18
19exec /opt/oar/current/bin/oarsh $HOST "$MYENV $@"
Note: See TracBrowser for help on using the repository browser.