how to test extension of file

From: dada (usenetdada_at_yahoo.com)
Date: 04/18/04


Date: 18 Apr 2004 01:33:21 -0700

hi,

i just wanted to know whether the "test" command has
an option for testing the extension of file.
i wanted to know if $x is of the form *.swp
where $x has the filename.

i know there is a way like
for i in *.swp
etc etc
but i want to test only for a particular file
thanks.



Relevant Pages

  • Re: Un-erasable folder
    ... >>> enclose the entire filename (including the path if you are not in its ... >>> parent directory). ... >> extension, so the use of one or more periods in a filename can get very ... Like the former deltree command. ...
    (microsoft.public.windows.file_system)
  • Re: Gpsbabel - how to do all files in a directory
    ... gpsbabel doesn't seem to support filename wildcards, so you have to do this ... ".mps" as the extension. ... The "FOR" command then processes that list, one file at a time, each time ...
    (sci.geo.satellite-nav)
  • Re: How to add a command to right click in Windows Explorer
    ... I tried this, and I did see a command window pop up, but it did not compile. ... I think it needs the full filename and extension passed to it. ... Click the File Types tab. ...
    (microsoft.public.windowsxp.general)
  • Re: Unable to delete folder
    ... Before the Long File Names should be a column showing the SFN (Short File Name, also known as the 8.3 filename) for each file whose LFN does not qualify as ... Then just use the Del command with the SFN: del endtro~1, for example - but the actual SFN might be something unexpected! ... Even with LFNs, each file has only a single extension, although many appear to have multiple extensions. ... Either Move it into another folder or Move everything except this file out of this folder. ...
    (microsoft.public.windows.file_system)
  • Re: Great SWT Program
    ... extension you want to give the destination file. ... because they also cover all sorts of formats beyond graphics formats. ... position to set up the relevant command. ...
    (comp.lang.java.programmer)