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:
in the shell script, so my folder name is:
and I want awk to print files into that directory.
I apologize in advance, but I continue to have trouble searching for matches between two files and then printing portions of each to output in awk and would very much appreciate some help.
I have data as follows:
File1
PS012,002 PRQ 0 1 1 17 1 0 -1 3 2 1 2 -1 ... (7 Replies)
Hi,
I have 2 .txt pads containing data.
I need a script which reads content of one .txt file, performs some operations and calculates a number which is stored in a variable.
Now , all the content of another .txt pad should be appended to first .txt pad at pre calculated nth line number.
... (4 Replies)
Hi,
I need to read a string with ; separated using loop one filed by one field and perform some operation. Can you please check and let me know how to print command parameterised.
key=phani;ravi;kiran
number_of_keys=`echo $key|awk '{print NF}' FS=';'`
for (( i = 1; i <= $number_of_keys;... (4 Replies)
Hi,
I'm trying to auto generate some php files with a default preamble at the top which is a block comment.
The problem is that my output has no new lines and it looks like the output from "ls" is being printed after everyline
This is my code
#!/bin/bash
read -d '' pre_amble... (1 Reply)
I am trying to figure awk.
I have a file in my home directory called testawk.sh, have made it executable, and have run it... But don't see any output.
This is the contents of the file:
#!/usr/bin/awk -f
{ print " - HI -" }I enter ./testawk.sh in the prompt, press enter, and watch as the... (2 Replies)
I am trying to get folder names that contain only numbers.
Can someone explain why following command is printing 'total 450' as part of output..
$> ls -lt | awk '$9 ~ /^*$/' | more
total 450
drwxr-x--x 3 user1 group1 512 Mar 9 2008 329227163
drwxr-x--x 3 user1 group1 ... (17 Replies)
Hello all,
I'm a beginner to shell/ awk script writing, and I'm trying to do something that looks like it shouldn't be (too) hard at all to do, but unfortunately, I can't seem to be able to find the right way to do it with awk.
I need to look for the time several processes start & end in a... (5 Replies)
Hi all,
I'm writing a program in bourne shell that compresses a file 3 different ways then displays a table of data with the compression type, original file size, compressed size and compression ratio. I've written most of it but reached 2 problems that won't allow me to finish it correctly.
The... (2 Replies)
The goal:
I have a list of people in teams. The list looks something like this
$1 = Job Position (marketing, IT, PR)
$2 = Name
$3 = Team Name
$4 = Targeted member (somebody in field 2 targets somebody else)
$5 = Employment Status (full time/part time/etc)
The idea is to search through... (2 Replies)
This is probably a fairly simple question but I cant seem to get it to work.
Im trying to multiply an entire column in a file by a variable in my bash script but just cant seem to get it to work with awk.
Here is what I'm trying
$varr is some value
$line is my file
awk '{print... (1 Reply)