10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and
I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server
$ cat temp.txt
RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies
2. HP-UX
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
3. Shell Programming and Scripting
Hi,
One of my Unix scripts needs to look for files coming in on Fridays. This script runs on Mondays. $date +"%y%m%d" will give me today's date. How can I get previous Friday's date.. can I do "today's date minus 3 days" to get Friday's date? If not, then any other way?? Name of the files is... (4 Replies)
Discussion started by: juzz4fun
4 Replies
4. Shell Programming and Scripting
Hi,
I am trying to capture the total run time of a script which contains SQL's by providing date command in top & bottom, it displaying both the times same in top & bottom.However the time in the sql connection is different.Please help.
OS - LINUX
Shell - ksh
printf "Script Started at... (3 Replies)
Discussion started by: nag_sathi
3 Replies
5. UNIX for Dummies Questions & Answers
I need to generate a report on the first of each month that will show me how many points are going to expire on a particular scheme for the next three months. The points expiry is not an issue what I have an issue with is finding the command to give me the last day of each month for the current and... (2 Replies)
Discussion started by: theref
2 Replies
6. Shell Programming and Scripting
When I write
Select date_field from TableA fetch first row only
I am getting the output as 09/25/2009.
I want to get the output in the below format
2009-09-25 i.e., MM-DD-YYYY. Please help (7 Replies)
Discussion started by: dinesh1985
7 Replies
7. Shell Programming and Scripting
Hi,
I wrote a simple shell script which accepts the input value yearmonth in the format YYYYMM and displays the date as YYYY-MM-DD.Day will be 01 always.Please find the code below
#!/bin/ksh
export yearmonth_date=$1
print_usage() {
echo "usage: ${0##*/} <yearmonth_date> \n" \
... (1 Reply)
Discussion started by: kavithakuttyk
1 Replies
8. Shell Programming and Scripting
I am currently running the following Korn shell script which works fine:
#!/usr/bin/ksh
count=`db2 -x "select count(*) from schema.tablename"`
echo "count"
I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies
9. Shell Programming and Scripting
Hi
Do you have any pointers how to validate numbers (not to contain alphabets and special characters) and date(MM/DD/YYYY) format.
I used following regular expression to validate integer, which is not working in the default shell:
nodigits="$(echo $testvalue | sed 's/]//g')"
... (4 Replies)
Discussion started by: alok_jax
4 Replies
10. UNIX for Dummies Questions & Answers
Good day folks,
This is my first post on this board and I thank you in advance for helping me with this issue.
Any idea how I can synchronize server time with another timeserver but have my server lag behind by 2 seconds?
Meaning...I need a simple unix script that I can run as crone that... (2 Replies)
Discussion started by: franklo
2 Replies