Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-16-2011, 03:44 PM   #1
Registered: Apr 2010
Posts: 62

Rep: Reputation: 2
ksh scripting

I need a way to script from the following file listing only the files dates Jan 13th and scp them to another server.

I can;'t think of a way to separate the July 13th files from the rest and then copy the files dates Jan 13 only off somewhere else.

I know how to scp and I can do it manually but I cannot think of a way to segregate the Jan 13th files and ignore the rest.

File listing:
rw-rw-rw-*** 1 eprprde* profile*** 22147536 Jan 13 21:00 xref.mjl_2011013210028
-rw-rw-rw-*** 1 eprprde* profile***** 566056 Jan 13 21:26 xref.mjl_2011013212620
-rw-rw-rw-*** 1 eprprde* profile*** 22067296 Jan 14 21:00 xref.mjl_2011014210034
-rw-rw-rw-** *1 eprprde* profile***** 328056 Jan 14 21:25 xref.mjl_2011014212552

If anyone has any ideas I would appreciate it.


Last edited by cheltz; 01-16-2011 at 06:41 PM.
Old 01-16-2011, 03:51 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
"2011013" looks like a date in the filename, though it's missing a digit. Assuming you mean JAN 13 not JUL 13, just scp *2011013* (or *20110113* - assuming there was a typo in your post).
1 members found this post helpful.
Old 01-16-2011, 06:41 PM   #3
Registered: Apr 2010
Posts: 62

Original Poster
Rep: Reputation: 2
Oh Geez ! Duh on my part. Thanks I never even noticed that.
Old 01-17-2011, 01:07 PM   #4
Registered: Apr 2010
Posts: 62

Original Poster
Rep: Reputation: 2
only one problem with the date in the file name.
the date is for example 2011013
If i used `date +%Y%d` I get 200113.
I don;t know how to get the "0" in there.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ksh scripting question unix1adm AIX 5 10-05-2010 09:10 AM
ksh scripting lqchangba AIX 5 07-04-2008 01:48 PM
ksh scripting lqchangba Linux - General 2 07-03-2008 07:01 AM
Three ksh scripting questions liguorir Linux - Software 2 10-22-2005 01:40 PM
some ksh scripting nabil Programming 1 03-03-2002 11:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration