Random Shell Script

Welcome to the random shell script of the week! This shell script is trivial but useful, especially if you don’t write this kind of stuff every other day. The following shell script will iterate over every file in the current directory and print the filename out.

#!/bin/sh

for file in ./*
do
   echo "$file"
done

You can modify the ./* to ./*jar to loop through all jar files.

Related posts:

  1. Print HTML Using IE
  2. Import Script, Import CSS, Import PHP
  3. More Ways To Open A Doc
  4. Invoke Javac At Runtime
  5. JavaFX Script

This entry was posted in TechKnow. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*