The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
am a newbie to unix. plz help in understanding this code. gokulj UNIX for Dummies Questions & Answers 1 12-23-2008 05:29 AM
Little Trouble Understanding some code... NycUnxer UNIX for Dummies Questions & Answers 2 10-31-2007 09:20 AM
Proper routing BOFH IP Networking 3 03-04-2007 12:36 AM
Where can I download the original Linux code for free? Super Apollo Linux 1 01-25-2006 02:08 AM
source code download tapanagkumar UNIX for Dummies Questions & Answers 1 07-19-2005 01:33 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-23-2008
mpinto mpinto is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 1
Newbi - Understanding the Code and proper download

Hi,
I am new to Unix and there is code that is trying to get data from a location and save it. However it's output is messing up some date fields in the source file (ie... in source is may say 10/10/2008, the code will output 10/10/20088). This is the piece of code. Can someone help to understand what it does and how it can be fixed? Thanks in advance!

#!/bin/ksh
#set final file
REPORT="/sas02/logistics/prom/incoming/LCL_KIT2_RPT.txt"
REPSRV="lcl####.ngco.com"
# using telnet through the http port 80 get the current name of the lcl promo file
REPURL=`(sleep 1; echo "GET /kixprod/cgi-bin/biceps_exec_log.pl?day=0 HTTP/1.0"; echo""; sleep 1) | telnet $REPSRV 80 | sed '/GROCERY.PROMOS/!d; s/.*ngco.com//; s/">.*//'`
#echo $REPURL
[[ -r $REPORT ]] && rm $REPORT
# using telnet through the http port 80 get the LCL_GROCERY_PROMO.txt file
(sleep 1; echo "GET $REPURL HTTP/1.0"; echo "Content-type: text/plain"; echo ""; sleep 60) | telnet $REPSRV 80 | sed "/,/!d; s/<.*>//; s/\&amp;/\&/; s/\&quot;/\q/" > $REPORT
  #2 (permalink)  
Old 12-24-2008
csorhand csorhand is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 81
mpinto,

I don't see any date in the piece of code you've provided. If your saying that it is appending the code 10/10/20088. Im recommending that you analyze your script and look for a function or script pertaining to date or appending to a date.

Cheers,
  #3 (permalink)  
Old 12-24-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Cool Related to the sed's ?

Can you show complete lines of input and output data?
My 2nd thought (after expecting a date command or obvoius data usage) is that one of the sed commands is duplicating the text.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0