[last updated - 31 July 2003]
This is a script that needs a bit more work to make sure it works in your environment. If you have studied the previous tips then you will easily be able to amend this code. It assumes you have created the titleprogs script as it uses it.
#!/bin/sh # Script : intitlesnoprogs # Version : 1.0 # Author : Roland Rashleigh-Berry # Date : 31 July 2003 # Contact : roland@rashleigh-berry.fsnet.co.uk # Purpose : To display what programs in the titles dataset are not in the # programs directory. # SubScripts : titleprogs # Notes : Assumes the titleprogs script has been written. You will need to # amend this script to ensure it is searching for program names # from the right location. # Usage : intitlesnoprogs # #================================================================================ # PARAMETERS: #-pos- -------------------------------description-------------------------------- # N/A (none) #================================================================================ # AMENDMENT HISTORY: # init --date-- mod-id ----------------------description------------------------- # #================================================================================ # This is public domain software. No guarantee as to suitability or accuracy is # given or implied. User uses this code entirely at their own risk. #================================================================================ # You must have written the titleprogs script. This shoudl be a list of unique # program names with no extension that will match the case of the actual program # names in the directories. titleprogs | awk '{print $0 ".sas"}' > $HOME/tprogs.tmp # I assume you have a root directory set up in an environment variable RD # and that the protocol follows this and the study follows that. I will extract # these and make that the current directory and search for all sas programs. protocol=`pwd | sed "s%^$RD%%" | awk -F/ '{print $1}'` study=`pwd | sed "s%^$RD%%" | awk -F/ '{print $2}'` cd $RD/$protocol/$study find . -name '*.sas' | sed 's%.*/%%' | sort -u > $HOME/progs.tmp join -v1 $HOME/tprogs.tmp $HOME/progs.tmp rm -f $HOME/tprogs.tmp $HOME/progs.tmp
Go back to the home page.
E-mail the macro and web site author.