It changes output_file from an awk variable into a string.
If you don't use the quotes, depending on your awk version either no output file will be written, or you'll get an error. If you declare an awk variable called output_file, then it would be fine:
Is it possible to process multiple variables in a single sed command?
I have the following ksh with three variables and I want to search for all variables which start with "var" inside input.txt.
I tired "$var$" but it just prints out everyting in input.txt and does not work.
$ more test.ksh... (5 Replies)
I need a script to process a huge single line text file:
The sample of the text is:
"forward_inline_item": "Inline", "options_region_Australia": "Australia", "server_event_err_msg": "There was an error attempting to save", "Token": "Yes", "family": "Family","pwd_login_tab": "Enter Your... (1 Reply)
Hi,
I am trying to do the following using AWK program.
1. Read the input data file
2. Parse the record and see if it contains errors
3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen
Here is what I have done -... (6 Replies)
Hi!
I have 2 files containing data that I need to process at the same time, I have problems in reading a different number of lines from the different files.
Here is an explanation of what I need to do (possibly with an awk script).
File "samples.txt" contains data in the format:
time_instant... (6 Replies)
Hi,
I'd like to process multiple files. For example:
file1.txt
file2.txt
file3.txt
Each file contains several lines of data. I want to extract a piece of data and output it to a new file.
file1.txt ----> newfile1.txt
file2.txt ----> newfile2.txt
file3.txt ----> newfile3.txt
Here is... (3 Replies)
Hi!
I'm new in awk and I need some help.
I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files.
Thanks in advance for help!
:-)
ciao (5 Replies)
hai i need my single awk script to act on 4 trace files of ns2 and to calculate througput and it should print result from each trace file in a single trace file. i tried with the following code but it doesnt work awk -f awkscript inputfile1 inputfile2 inputfile3 inputfile4>outputfile ... (4 Replies)
Hi All,
I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd.
What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
Hi,
I'm using awk command in bash script. I'm able to pass multiple files to awk for processing.The code i can use is as below(sample code)
#!/bin/bash
awk -F "," 'BEGIN {
...
...
...
}' file1 file2 file3
In the above code i'm passing the file names manually and it is fine till my... (7 Replies)
Discussion started by: shree11
7 Replies
LEARN ABOUT NETBSD
time
TIME(3) BSD Library Functions Manual TIME(3)NAME
time -- get time of day
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <time.h>
time_t
time(time_t *tloc);
DESCRIPTION
The time() function returns the value of time in seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal Time.
A copy of the time value may be saved to the area indicated by the pointer tloc. If tloc is a NULL pointer, no value is stored.
Upon successful completion, time() returns the value of time. Otherwise a value of ((time_t) -1) is returned and the global variable errno
is set to indicate the error.
ERRORS
No errors are defined.
SEE ALSO gettimeofday(2), ctime(3)STANDARDS
The time() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1'').
HISTORY
A time() function appeared in Version 2 AT&T UNIX. It returned a 32-bit value measuring sixtieths of a second, leading to rollover every
2.26 years. In Version 6 AT&T UNIX, the precision of time() was changed to seconds, allowing 135.6 years between rollovers.
In NetBSD 6.0 the time_t type was changed to be 64 bits wide, including on 32-bit machines, making rollover a concern for the far distant
future only. Note however that any code making the incorrect assumption that time_t is the same as long will fail on 32-bit machines in
2038.
BSD November 5, 2011 BSD