X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS,TW_CV,TW_VZ,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Corwin Joy Subject: Send To .tar.gz Date: Wed, 1 Dec 2010 18:33:00 +0000 (UTC) Lines: 36 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I use cygwin a lot and I wanted to create a windows XP "Send To" shortcut that would allow me to "Send" a folder from windows explorer to a .tar.gz file. (Rather like the compress folder item, but compress to a .tar.gz format). It turned out to be fairly simple to create this, here is the code below in case someone else wants to do this. 1. Create a script to compress a windows directory path. I called this send_to_tar_gz.sh and placed it in my home directory. --------- #!/bin/sh bin=/bin # Executables in Cygwin space(Windows PATH may not include it) if [ "${1}" = "" ]; then XPATH="."; else XPATH="$($bin/cygpath -u -a "${1}")"; fi echo "creating .tar.gz of" "$XPATH" $bin/tar -cvzf "${XPATH}.tar.gz" "$XPATH" ------- 2. Create a windows "Send To" shortcut as explained here: http://support.microsoft.com/kb/310270 C:\cygwin\bin\bash.exe --login -i send_to_tar_gz.sh Note that I needed to use --login -i arguments because a. I placed the shell script in my home directory. b. If I just used bash the tar command had problems finding the gzip command to compress the tar file, I'm not quite sure why. Something to do with the path I think. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple