I am trying to insert a line with a date stamp in a file that is used to monitor activity in one of our directories. By doing this, I want to grep that file each day and go to the last entry for each time a error occurred and pull all errors generated if any exist. If error exists I want that error... (3 Replies)
how to assign values in this date format
a=`date +"%H%M%S"`
how to give value of H=22,here in this format so that i can grep 22nd hour.Below is the script
--------------------------------------------------------------------------
a=`date +"%H%M%S"`
for i in *.log
do
cat $i | grep $a... (3 Replies)
File.jpg
I want to copy and rename this as 2008-12-02.jpg
I tried this copy File.jpg date '%y-%m-%d-%H:%M:%S'.jpg
This doesnt work.... what do i do? (1 Reply)
Hello,
I am inside a awk script on AIX, I am feeding to awk ls -luNR
i need to convert ls -u time format "month day h:m/yr" to Unix epoch time, POSIX time, or aka unix timestamp
I do not have strftime funk in my awk, and i have to do this fast meaning that I cannot do a system call in the... (1 Reply)
hi there, my mysql database has a date/time field using the standard mysql date|time format of
2009-08-31 00:16:44
when inserting into this field using perl DBI, is there is an easy way to insert the current date/time in without having to preformat the date/time string in perl before... (3 Replies)
Hi All,
I need to prepare a shell script in UNIX to insert 400 spaces after a variable in a file "file.txt".
Eg. if n=T12345
echo $n >> file.txt
cat file.txt should give:
T12345<400 spaces>
Please... (5 Replies)
Hi,
i am writing a ksh shell script to check the last month end date whether it is falling in last 10 week day date, I am not sure How to use "Mr. Perderabo's date calculator", Could you Please let me know how to use to get my requirement, I tried my own script but duplicate week day and... (5 Replies)
There are 2 dates,
Tue Oct 1 13:40:19 2013
Sun Sept 30 10:26:23 2013
I have multiple dates like the above one. How do I calculate the date time difference and display in another column in Shell script. Please help. (3 Replies)
hi all,
In first run,I am inserting a row into an oracle table through shell script,
in the same shell script when I query this table the count comes as 0.
When I run the same script again then the count comes correctly,
Can anyone help how can I get the count of the row correctly in the... (3 Replies)
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
LEARN ABOUT OPENSOLARIS
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgawk |
+--------------------+-----------------+
|Interface Stability | Volatile |
+--------------------+-----------------+
NOTES
Source for gawk is available on http://opensolaris.org.
Free Software Foundation Nov 3 1999 IGAWK(1)