plumber

Plumber – a modern approach to plumbing
git clone git://r-36.net/plumber
Log | Files | Refs | README | LICENSE

pageropener (394B)


      1 #!/bin/sh
      2 #
      3 # Copy me if you can.
      4 # by 20h
      5 #
      6 
      7 f="$1"
      8 
      9 [ -z "$PAGER" ] && PAGER="less"
     10 [ -z "$SHELL" ] && SHELL="sh"
     11 
     12 if [ -t 1 ];
     13 then
     14 	if [ -d "${f}" ];
     15 	then
     16 		cd "${f}"
     17 		$SHELL
     18 	else
     19 		if [ -e "${f}" ];
     20 		then
     21 			$PAGER "${f}" 
     22 		fi
     23 	fi
     24 else
     25 	if [ -d "${f}" ];
     26 	then
     27 		$XTERM -e sh -c "cd \"${f}\"; $SHELL"
     28 	else
     29 		if [ -e "${f}" ];
     30 		then
     31 			$XTERM -e sh -c "$PAGER \"${f}\""
     32 		fi
     33 	fi
     34 fi
     35