Scripts - Dynamic text


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scripts - Dynamic text
# 1  
Old 09-24-2010
Scripts - Dynamic text

Hi,

I have a file in which I have to replace the text with system date. The text needs to be changed on daily basis automatically.
Assume, in "test.txt", I have below lines:
LOAD FILE
MYFILE 'c:/test/test_2010_09_24.txt
-----
-----

In the above, MYFILE value changes every day, the next day it should be
MYFILE 'c:/test/test_2010_09_25.txt (i.e. the filename format is 'test_<yyyy>_<mm>_<dd>' from system date.

How can we do this by shell script?

Thanks in advance.
# 2  
Old 09-24-2010
Code:
MYFILE="c:/test/test_$(date +%Y_%m_%d).txt"


Last edited by frans; 09-24-2010 at 06:32 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Text color in Linux scripts via putty

hi Folks, Can anyone help with changing the color of the words in a linux shell script? I get how to change default background etc in putty, but for some reason the text in the script has different colors for different parts of the cript. Is there a way to have one color in a linux shell... (5 Replies)
Discussion started by: jonnyd
5 Replies

2. UNIX for Dummies Questions & Answers

Generating Dynamic Scripts

Hi, Please give me an idea on how to achieve the below using a unix script. From our source team we are getting files with in-proper delimiters because of which our data load is failing to avoid this we want to generate dynamic scripts as below. Read the no of delimiters(which is dynamic... (6 Replies)
Discussion started by: mora
6 Replies

3. Homework & Coursework Questions

Problem with Shell Scripts deleting text in files.

Me and a friend are working on a project, and We have to create a script that can go into a file, and replace all occurances of a certain expression/word/letter with another using Sed. It is designed to go through multiple tests replacing all these occurances, and we don't know what they will be so... (1 Reply)
Discussion started by: Johnny2518
1 Replies

4. OS X (Apple)

Need Help with GREP REGEX scripts for common BB-EDIT text-editing

Hi Everybody.. I'm a "newbie" to using Command-line... A few half-remembered DOS commands from 30 years ago, and the very handy "Sudo rm -R pathname" REMOVE command... I do a lot of "cleaning" of plain-text OCR text files. with assorted common line-break, punctuation and capitalization... (1 Reply)
Discussion started by: TheMacGuy
1 Replies

5. Shell Programming and Scripting

Some scripts for text files needed

Hi, does anyone have some of those scripts or maybe have idea how to make them? ------------------------------------ 1) block of text multiplication n times: e.g. something1 something2 something3 something4 something5 something6 result: something1 something2 something3 something4... (2 Replies)
Discussion started by: spuzh
2 Replies

6. Web Development

Dynamic text field

Hi I have a webpage where I have a dropdown box and depending on the selection I would like to populate a text field . Preferably with JavaScript (2 Replies)
Discussion started by: bombcan
2 Replies

7. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

8. UNIX for Advanced & Expert Users

Sql dynamic table / dynamic inserts

I have a file that reads File (X.txt) Contents of record 1: rdrDESTINATION_ADDRESS (String) "91 971502573813" rdrDESTINATION_IMSI (String) "000000000000000" rdrORIGINATING_ADDRESS (String) "d0 movies" rdrORIGINATING_IMSI (String) "000000000000000" rdrTRAFFIC_EVENT_TIME... (0 Replies)
Discussion started by: magedfawzy
0 Replies

9. UNIX for Dummies Questions & Answers

Parsing text from one line with shell scripts

Hi Gurus! I wonder if anyone can help me, I'm sure you guys can. I have a text file which contains a lot of data on the one line as follows: $ What I need to do is pull all of those id values out (eg 2549425) and write them to a list in a text file. Any help would be greatly... (3 Replies)
Discussion started by: th3g0bl1n
3 Replies

10. Shell Programming and Scripting

Converting Text File into XML using Unix Shell Scripts

Hi everyone, If someone out there could help me out with this problem. I would really appreciate it. I am trying to convert a file into xml format using Unix shell scripts. The file has fields with each field having a certain number of bytes, but the fields are not delimited by anything... (10 Replies)
Discussion started by: Laud12345
10 Replies
Login or Register to Ask a Question