The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-28-2008
ccox85 ccox85 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 27
Trouble with printing to other folders w/ awk

Again, I am in need of some advice.

Earlier I was shown how to have awk create folders for me. That was so cool and helpful, but now I am exploring the posibilities of combining operations with bash scripts.

Now, I am creating the directories with the bash script, and then I want awk to print to those directories. My first error is that I dont know how to open up communication between the shell proper and awk, which is annoying, but also I wanted the shell to date the directories, which was easy enough but I cant figure out how to have awk match those file names, seeing as the date is going to change... daily.


I am wondering, is there a way to use a regular expression in the output path, so it will always identify the first part of the directory name and the reg expression will identify the date?

Or, is there a way to work the date straight into the file path so that it updates with the system time as well. I am using:


Code:
date +%F

in the shell script, so my folder name is:


Code:
mkdir "iat_data_`date +%F`"

and I want awk to print files into that directory.

Thanks!