#!/bin/sh # Set a path for libreoffice program in opt # # Find the newest libreoffice directory and set $LODIR to that: for lofficedir in /opt/libreoffice* ; do if [ -d $lofficedir ]; then LODIR=$lofficedir fi done export PATH="$PATH:$LODIR/program"