Sponsored Content
Full Discussion: Grepping Date Variable
Top Forums Shell Programming and Scripting Grepping Date Variable Post 302424716 by bakunin on Wednesday 26th of May 2010 06:45:21 AM
Old 05-26-2010
Quote:
Originally Posted by ravzter
Code:
line 4: read: `Enter date: MM-DD-YYYY?vdate': not a valid identifier

Sorry, my bad. Actually it was a typo. The correct line should read (the text and the variables name should be reversed):

Code:
read vdate?"Enter date: MM-DD-YYYY"

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grepping a variable

I need to pass a parameter that will then be grepped. I need it to grep /paramater and then have a space so if 123 was passed my grep would be grep '/123 ' sample.log this works fine from the command line but when i try and set it searchThis="/$2 " and then run grep $searchThis... (6 Replies)
Discussion started by: magnia
6 Replies

2. Shell Programming and Scripting

Grepping file and returning passed variable if the value does not exist in file at all.

I have a list of fields that I want to check a file for, returning that field if it not found at all in the file. Is there a way to do a grep -lc and return the passed variable too rather then just the count? I am doing some crappy work-around now but I was not sure how to regrep this for :0 so... (3 Replies)
Discussion started by: personalt
3 Replies

3. Shell Programming and Scripting

Display file date after grepping a string in the file

Hi All, I need to recursively grep several folders for a MAC address and display the results with the date of the file name at the start. Even better would be if the final results were displayed chronologically so the newest file is always at the end. Oldest at the top, regardless of what... (8 Replies)
Discussion started by: quemalr
8 Replies

4. Shell Programming and Scripting

Grepping for variable in brackets

I have a script which reads a number out of a log file. The pertinent line is this: cat /tmp/listofnumbers When I run cat /tmp/listofnumbers what I am seeing is on each line. I am trying to make the script read from that file and grep for a variable like the following line should do: ... (4 Replies)
Discussion started by: newbie2010
4 Replies

5. Shell Programming and Scripting

Grepping the file into a variable after SSH into a server

Hi All, When i am logged into a server , i am able to assign grep value to a variable as follows. VAR=`grep 'Listener stopped' /logs/perf.log` However, when i log out of the server, and try to execute the following command by first SSHing into server, it throws error. $ VAR=`ssh Server... (4 Replies)
Discussion started by: srkmish
4 Replies

6. Shell Programming and Scripting

Convert a date stored in a variable to epoch date

I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date #!/usr/bin/ksh set -x for s in server ; do ssh -T $s <<-EOF from_date="12-Jan-2015 12:02:09" to_date="24-Jan-2015 13:02:09" echo \$from_date echo... (7 Replies)
Discussion started by: raj48
7 Replies

7. Shell Programming and Scripting

How to handle grepping variable data containing wildcards?

I have a lot of files with keywords and unique names. I'm using a shell script to refer to a simple pattern file with comma separated values in order to match on certain keywords. The problem is that I don't understand how to handle the wildcard values when I want to skip over the unique names. ... (5 Replies)
Discussion started by: abercrom
5 Replies

8. Shell Programming and Scripting

Grepping the data between 2 date ranges

Hi There, Good Day !! I have txt file containing data in the below format. There are many lines, here i have mentioned for example. cat remo.txt 2/3/2017 file1 3/4/2016 file2 6/6/2015 file5 1/1/2018 file3 4/3/2014 file4 - - - I need to grep the file names for given date rage... (11 Replies)
Discussion started by: kumar85shiv
11 Replies

9. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies

10. UNIX for Beginners Questions & Answers

Grepping for one variable while using awk to parse an associated variable

Im trying to search for a single variable in the first field and from that output use awk to extract out the lines that contain a value less than a value stored in another variable. Both the variables are associated with each other. Any guidance is appreciated. File that contains the... (6 Replies)
Discussion started by: ncwxpanther
6 Replies
datefield(3tk)							Tk datefield widget						    datefield(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
datefield - Tk datefield widget SYNOPSIS
package require Tk package require datefield ?0.2? ::datefield::datefield widgetpath ?options? _________________________________________________________________ DESCRIPTION
The datefield package provides the datefield widget which is an enhanced text entry widget for the purpose of date entry. Only valid dates of the form MM/DD/YYYY can be entered. The datefield widget is, in fact, just an entry widget with specialized bindings. This means all the command and options for an entry wid- get apply equally here. COMMANDS
::datefield::datefield widgetpath ?options? Creates and configures a date field widget. OPTIONS
See the entry manual entry for details on all available options. EXAMPLE
package require datefield wm title . "Datefield example" proc DayOfWeek {args} { set now [clock scan $::myDate] set ::myDate2 [clock format $now -format %A] } trace variable myDate w DayOfWeek ::datefield::datefield .df -textvariable myDate label .l1 -text "Enter a date:" -anchor e label .l2 -text "That date is a:" -anchor e label .l3 -textvariable myDate2 -relief sunken -width 12 grid .l1 .df -sticky ew grid .l2 .l3 -sticky ew focus .df SEE ALSO
clock(3tcl), entry(3tk) KEYWORDS
clock, entry, widget COPYRIGHT
Copyright (c) Keith Vetter <keith@ebook.gemstar.com> datefield 0.2 datefield(3tk)
All times are GMT -4. The time now is 04:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy