On Fri, Nov 07, 2008 at 11:37:55PM +0530, Harsimran Walia wrote:
> I wanted to ask one thing which is not related to this thread . I appologize
> for that as it is very small thing so making another thread was no worth.
> i wanted to no that if i have file like abc.jpg is there a command which can
> just give me the name abc without extension or do i need to make a script
> for doing this actually i need to rename them from abc.exe to abc.jpg 100's
> of files.

Harsimran, I had a similar problem when I had a lot of .png files, each
of which I had to convert to .png. I wrote a simple tcsh/csh script -
This uses the same magic of cut :-) just gets to a delimiter `.', and
takes in the first field.
------------------------------------------------------------------------
#!/bin/csh -f
foreach x (`/bin/ls *.png`)
echo converting $x to `/bin/ls $x | /bin/cut -d\. -f1`.jpg
/usr/bin/convert $x `/bin/ls $x | /bin/cut -d\. -f1`.jpg
end
------------------------------------------------------------------------
Hope this helps,
Cheers, Sumantra.
--
*********************************************************************
SUMANTRA DUTTA ROY                     Ph Office: +91 - 11 - 26591084
Department of Electrical Engineering   Ph Resid.: +91 - 11 - 26597084
Indian Institute of Technology Delhi   Ph MM Lab: +91 - 11 - 26596167
Hauz Khas, New Delhi - 110016, INDIA   Facsimile: +91 - 11 - 26581606
http://www.cse.iitd.ac.in/~sumantra/   email: [EMAIL PROTECTED]
Office: II-245, Res: 38 North Avenue   email:  [EMAIL PROTECTED]
_____________________________________________________________________
             UDYOGINAM   PURUSHASIMHAM   UPAITI  LAKSHMEEH
             DAIVEN   DEYAM   ITI   KAAPURUSHAAH   VADANTI
             DAIVAM  NIHATYA KURU PAURUSHAM  AATMASHAKTYAA
             YATNE  KRITE  YADI NA SIDHYATI KO ATRA DOSHAH
                     (Favourite Sanskrit Shloka)
*********************************************************************

--~--~---------~--~----~------------~-------~--~----~
[EMAIL PROTECTED] mailing list -- group http://groups.google.com/group/iitdlug
-~----------~----~----~----~------~----~------~--~---

Reply via email to