pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by frymaster on Mon 14th Oct 16:15
download | new post

  1.   #!/bin/bash
  2.  
  3.   Clear_JobPatch ()
  4.   {
  5.   Path="$1"
  6.   # Clear the file
  7.   rm -f /tmp/temp.txt
  8.    
  9.   # create the file with list of printers / drivers
  10.   ls "$Path" | grep -v '^[.*]' | grep "Xerox" > /tmp/temp.txt
  11.    
  12.   # remove the "JobPatchFile 1" line
  13.   cat /tmp/temp.txt | ( while read DriverNm;
  14.   do
  15.   echo $DriverNm
  16.   # 2 evil lines so swap about
  17.   cat "${Path}${DriverNm}" | grep -v "JobPatchFile 1" > "${Path}${DriverNm}".tmp
  18.    cat "${Path}${DriverNm}".tmp | grep -v "*cupsCommands:" > "${Path}${DriverNm}"
  19.   #perl -pi -w -e 's/"ReportLevels ReportStatus AccountingConfiguration"/"AccountingConfiguration"/g;' "$Path""$DriverNm"
  20.    
  21.   done)
  22.   }
  23.    
  24.   # Fix the drivers
  25.   Path="/Library/Printers/PPDs/Contents/Resources/"
  26.   gunzip -r "${Path}"
  27.   Clear_JobPatch "${Path}"
  28.   gzip -r "${Path}"
  29.    
  30.   sleep 2
  31.    
  32.   # Fix any printers
  33.   Path="/private/etc/cups/ppd/"
  34.   Clear_JobPatch "${Path}"
  35.    
  36.   exit 0;

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings