]] SORRY FOR NANO-)CODE( SIZE [[ brianp@raptor:~$ eng path [[ env | grep -i => check PATH]] PATH=/home/brianp/bin/psh:/home/brianp/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games brianp@raptor:~$ fcmd.pl psr [[ Search $ENV{PATH} for target ]] /home/brianp/bin/psh/psr.sh /home/brianp/bin/psr.pl brianp@raptor:~$ ll `fcmd.pl psr` [[ Check paths and exec perms ]] -rwxr--r-- 1 brianp brianp 62 Jan 30 11:30 /home/brianp/bin/psh/psr.sh* -rwxr--r-- 1 brianp brianp 217 Sep 5 2001 /home/brianp/bin/psr.pl* brianp@raptor:~$ cat `fcmd.pl psr` [[ check for [more] buggy code ]] #!/bin/sh /usr/local/bin/perl -w /home/brianp/bin/psr.pl "$@" ... #!/usr/local/bin/perl -w # PSR - Perl Search & Replace. Replacement for the #%%&^*# braindead sed. $target = $ARGV[0]; # Target to search for is the first argument. for() { eval $target; print $_; } [[ Check for actual functionality... Filter BLANK lines ]] brianp@raptor:~$ /usr/local/bin/perl -v | psr.sh "s/^\s*$//" | head -n 2 This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux Copyright 1987-2015, Larry Wall [[ psr.sh does filter top blank line! ]] brianp@raptor:~$ /usr/local/bin/perl -v | head -n 2 [[ blank line starts spew ]] This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux brianp@raptor:~$ /usr/local/bin/perl -v | psr.pl "s/^\s*$//" | head -n 2 This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux Copyright 1987-2015, Larry Wall [[ blank line gone, Larry's Baaaaaaaak ]] brianp@raptor:~$ psr 2>&1 | head -n1 No command 'psr' found, did you mean: brianp@raptor:~$ whoami brianp brianp@raptor:~$ eng shell SHELL=/bin/bash brianp@raptor:~$ cat /etc/debian_version jessie/sid [[ Ubuntu 15.10 -> Wily Werewolf ??] brianp@raptor:~$ uname -a Linux raptor 4.2.0-25-generic #30-Ubuntu SMP Mon Jan 18 12:31:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux brianp@raptor:~$ ll /bin/sh [[ Not regular sh/bash]] lrwxrwxrwx 1 root root 4 Jan 22 23:48 /bin/sh -> dash* [[ shell made by iceholes to confound infidles? ]] brianp@raptor:~$ ll `which dash` -rwxr-xr-x 1 root root 125400 Jun 4 2015 /bin/dash* #### brianp@raptor:~$ file `fcmd.pl psr` /home/brianp/bin/psh/psr.sh: POSIX shell script, ASCII text executable /home/brianp/bin/psr.pl: a /usr/local/bin/perl -w script, ASCII text executable, with CRLF line terminators