Skip to content

Instantly share code, notes, and snippets.

@sixman9
Created January 9, 2011 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sixman9/771482 to your computer and use it in GitHub Desktop.
Save sixman9/771482 to your computer and use it in GitHub Desktop.
Awk variable assignment for loop
for myFileSetVar in `find /some/path -iname '*some.file*'`; do newAwkVar=`echo $myFileSetVar | awk -F/ '{print $1}'`; echo $newAwkVar came from $myFileSetVar; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment