Skip to content

Instantly share code, notes, and snippets.

@sixman9
Created January 9, 2011 06:29
Show Gist options
  • Select an option

  • Save sixman9/771482 to your computer and use it in GitHub Desktop.

Select an option

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