LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-30-2003, 03:33 PM   #16
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63

on the get (RETR) can it be full path?
so something like: get /root/http/myfiles/welcome.cfm
Having a tough time with the " marks...
 
Old 07-30-2003, 03:45 PM   #17
letmein
LQ Newbie
 
Registered: Jul 2003
Posts: 24

Original Poster
Rep: Reputation: 15
not really
 
Old 07-30-2003, 03:57 PM   #18
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
try this...

sed 's/RETR..RETR\(.*\) \(.*\)/get \2/g' FILENAME |sed 's/get \/...*...\//get /g' | sed 's/STOR..STOR\(.*\) \(.*\)/put \2 \1/g' |sed 's/RNTO..RNTO\(.*\) \(.*\)/rename \2 \1/g' | sed 's/RNFR..RNFR\(.*\) \(.*\)/rename \2 \1/g'| sed 's/rename.*.\"$/&Makethisgoaway/g' | sed 's/put.*.\"$/&Makethisgoaway/g' | sed 's/.Makethisgoaway//g'

sorry for all the mickey mouse things I've thrown in to work around the " marks.
 
Old 07-31-2003, 09:36 AM   #19
letmein
LQ Newbie
 
Registered: Jul 2003
Posts: 24

Original Poster
Rep: Reputation: 15
Morning Blinker ...

every thing works fine as told by you ... theres another problem i didnt mention . its like if my org log file loooks like as shown below:

RNFR "RNFR welcome.txt" /root/http/myfiles/welcome.txt
RNTO "RNTO hello.txt"

we need to change the file name from "welcome.txt" to "hello.txt", but the code we are using to change it ... which looks like this:

sed 's/RNFR.*RNFR\(.*\) \(.*\)/rename \2 \1/g' | sed 's/rename.*.\"$/&removethis/g' | sed 's/.removethis//g'

will change the orginal log file to something like this:

rename /root/http/myfiles/welcome.txt welcome.txt

but this is not we want we want the file name to be renamed to the new filename ie the o/p should be something like this:

rename /root/http/myfiles/welcome.txt hello.txt

not rename /root/http/myfiles/welcome.txt welcome.txt


you know what i mean????


thanks for all the help .....
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sed and escaping & in something like: echo $y | sed 's/&/_/g' prx Programming 7 02-03-2005 11:00 PM
Sed q? ky-lab_rat Linux - Software 5 10-26-2004 07:59 AM
Insert character into a line with sed? & variables in sed? jago25_98 Programming 5 03-11-2004 06:12 AM
Help with sed odious1 Linux - General 2 08-29-2003 10:52 AM
help with sed DavidPhillips Programming 3 08-11-2003 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:33 AM.

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