home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   TUXPOWER      Advocacy for the Linux operating system      1,237 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 141 of 1,237   
   Maurice Kinal to Jame Clay   
   Extracting file names using Bash   
   06 Feb 12 13:47:16   
   
   Hey Jame!   
      
   Weird characters showing up here so I'll take the liberty of reposting your   
   code below.   
      
   ----- ye ol' gpm cut n' paste starts   
      
   file="thisfile.txt"   
   echo "filename: ${file%.*}"   
   echo "extension: ${file##*.}"   
      
   ----- ye ol' gpm cut n' paste ends   
      
   The result of this on the commandline yeilds;   
      
   $ echo "filename: ${file%.*}"   
   filename: thisfile   
   $ echo "extension: ${file##*.}"   
   extension: txt   
      
   Seems to work great.  For the record the ascii code for the " characters are   
   not <83> <9D> which is what I see in your post.  They are really 0x22 or 22h   
   or decimal 32 or U+0022 (<- utf8).  ;-)   
      
   Life is good,   
   Maurice   
      
   --- GNU bash, version 4.2.20(2)-release (x86_64-core2-linux-gnu)   
    * Origin: Pointy Stick Society (1:261/38.9)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca