help....generate command script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help....generate command script
# 8  
Old 02-19-2009
If the GNU version of date is avalaible on your system, you don't need the convertime.sh script.

Code:
$ date -d @1233743410  +'%Y%m%d%H%M%S'
20090204113010
$

Jean-Pierre.
# 9  
Old 02-19-2009
Quote:
Originally Posted by danmero
You don't need the convertime.sh Smilie this basic script will do what you want.
Code:
#!/bin/sh
while read name
do
   echo cp "$name" `date -d "${name%.*}" "+%Y%m%d%H%M%S"`.log
done < file.list

Replace the file.list by your file name, check the output and when you are satisfied remove the echo.

and please read some "Scripting for beginners"
my server don't have date -d function.....
# 10  
Old 02-20-2009
Quote:
Originally Posted by bleach8578
my server don't have date -d function.....
How should I know that Smilie
.. and what is your server(OS) ?
# 11  
Old 02-23-2009
It's ok now for my script. Thanks for your help.

Last edited by bleach8578; 02-23-2009 at 04:02 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How do I generate a script with an inverse action?

I have an interactive script which sorts and processes a variety of filetypes from an unsorted folder into newly created directories. The script works great, But I was wondering how I could generate a script with an inverse action so that I could unwind / undo the executed script and its sorting... (3 Replies)
Discussion started by: Braveheart
3 Replies

2. Shell Programming and Scripting

Generate documentation for a shell script

Hi, I've written a shell script with proper intentation and commenting structure. However, I would like to generate documentation for the shell which I have written. Is there any tool as such to generate it like we have javagen/docgen ? Please help. Thanks, Arjun (0 Replies)
Discussion started by: arjun_arippa
0 Replies

3. UNIX for Dummies Questions & Answers

Need script to generate file.

Hi I have a file "test" with data as below 1,APRIL,NEW,"New market,delhi,pune,India",RECENT, 254664 2,MARCH,OLD,"New Area,Mumbai,UP,India",CURRENT, 152483 So I want a script which provides output as below 1,APRIL,RECENT,254664 2,MARCH,CURRENT,152483 I am aware we can use awk/sed... (9 Replies)
Discussion started by: sv0081493
9 Replies

4. Shell Programming and Scripting

generate a script that will do the following

I need to write a shell script that will do all this: Go to server directory, for example (/xyz/outbound) In the outbound folder, get the list of the (old) directories created or modified at least two days before the date when script is run. The list will have the names of directories, some... (2 Replies)
Discussion started by: chako_3
2 Replies

5. Shell Programming and Scripting

Script to generate passwd comb.

Hi I created a gnupg password which I later forgot clumsy enough (after a holiday). I can always create a new one but unfortunately I have some files on the computer that I encrypted with it and would like to access it. I remember parts of the password and was wondering what's the the best way to... (0 Replies)
Discussion started by: zaonline
0 Replies

6. Shell Programming and Scripting

How to generate cntl+c interrupt through script?

Hi all, can anyone tell me how to generate control+c interrupt through shell script. (2 Replies)
Discussion started by: rohitmahambre
2 Replies

7. Shell Programming and Scripting

Generate command with awk

Hello, I have the line underneath generated by lssyscfg command: """51/client/1/pcyaz0hjfv00-vio1/651/c050760107fd0466,c050760107fd0467/1"",""52/client/2/pcyaz0hjfv01-vio2/652/c050760107fd0468,c050760107fd0469/1"",""31/client/1/pcyaz0hjfv00-vio1/375/c050760107fd046a,c050760107fd046b/1"""... (1 Reply)
Discussion started by: khalidou13
1 Replies

8. Shell Programming and Scripting

Script to generate a list of number

How can I generate a list of numbers and place all of these numbers in a line-by-line into a file. I am new to scripting actually. 0501000000 to 0509999999 i.e. 0501000000 0501000001 ...... 0509999999 set 02 0551000000 to 0559999999 i.e. 0551000000 0551000001 ...... 0559999999 ... (3 Replies)
Discussion started by: noo
3 Replies

9. Shell Programming and Scripting

how to generate html file using script?

Hi Friends I have an requirement that i need to generate html file using script. and the script output shold keep adding to that html file like tablewise. can anyone please help me out in this. thanks Krish. (2 Replies)
Discussion started by: kittusri9
2 Replies
Login or Register to Ask a Question