Unix Technical Forum

'lot'-a-trouble ...

This is a discussion on 'lot'-a-trouble ... within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Kleeb wrote: > Typical that I didn't think of simply rewriting the *whole* script again > whilst ssh'd into ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-19-2008, 02:59 PM
Joost Kremers
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

Kleeb wrote:
> Typical that I didn't think of simply rewriting the *whole* script again
> whilst ssh'd into slack. I was only changing bits of it, oblivious
> to the fatal 'invisible' characters that were still present in the script.


just use emacs from now on. it puts a big shiny 'DOS' in the status line
when you edit a file with \n\r instead of \n. ;-)

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 02-19-2008, 02:59 PM
adam mcmaster
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

On Mon, 23 Aug 2004 23:23:08 +0000, Kleeb wrote:

> On 2004-08-23, Joost Kremers <joostkremers@yahoo.com> schrieb :
>> c&p-ing it from the windows box? and after that, did you try running it
>> locally again? i'm betting the answers here are yes and no,
>> respectively. ;-)

>
> Kind of .. I think what I actually did was something rather stupid as
> it turns out. I wrote the script again in a Windows text editor (not
> notepad, Crimson Editor) after hosing my dualboot XP/Slack box. I won't
> bore you with the details of that experience.


You probably could've run dos2unix on the script to fix the line endings,
rather than rewriting it. But that doesn't matter now
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 02-19-2008, 02:59 PM
Kleeb
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

On 2004-08-23, Joost Kremers <joostkremers@yahoo.com> schrieb :
> Kleeb wrote:
>> Typical that I didn't think of simply rewriting the *whole* script again
>> whilst ssh'd into slack. I was only changing bits of it, oblivious
>> to the fatal 'invisible' characters that were still present in the script.

>
> just use emacs from now on. it puts a big shiny 'DOS' in the status line
> when you edit a file with \n\r instead of \n. ;-)


I think vim does too. But I was like "oh, yeah DOS. cool". Aaannnnd carry on
regardless ...

Cordially,

Kleeb.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 02-19-2008, 02:59 PM
Kleeb
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

On 2004-08-23, adam mcmaster <madcow@moosoft.net> schrieb :
>
> You probably could've run dos2unix on the script to fix the line endings,
> rather than rewriting it. But that doesn't matter now


Thanks for the tip. Given the amount of times I've looked at the script, I
know it off by heart now. Unfortunately.

Cordially,

Kleeb.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 02-19-2008, 02:59 PM
Rich Grise
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

Kleeb wrote:

> On 2004-08-23, Joost Kremers <joostkremers@yahoo.com> schrieb :
>> Kleeb wrote:
>>> Typical that I didn't think of simply rewriting the *whole* script again
>>> whilst ssh'd into slack. I was only changing bits of it, oblivious
>>> to the fatal 'invisible' characters that were still present in the
>>> script.

>>
>> just use emacs from now on. it puts a big shiny 'DOS' in the status line
>> when you edit a file with \n\r instead of \n. ;-)

>
> I think vim does too. But I was like "oh, yeah DOS. cool". Aaannnnd carry
> on regardless ...
>

Well, it's just a CR. It should ignore that, shouldn't it?

;-Q

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 02-19-2008, 03:04 PM
Hayley Wesson
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

On Mon, 23 Aug 2004 11:52:35 +0000, Kleeb wrote:

> Thanks for the reply Joost. Here is my modified version :
>
> #!/bin/bash
> /bin/date
> echo -e "\nHere is the table of all the syndicate numbers ...\n"
> /bin/cat -n /home/foo/lottery.txt
> echo -e "\nWinning numbers :\n"
> /bin/cat /home/foo/winhope.txt
> echo -e "\nMatching lines :\n"
> /bin/grep -nof /home/foo/winhope.txt /home/foo/lottery.txt


<snip>

> : No such file or directorytxt


This looks like it may be the winner.. Try this:


#!/bin/sh
/bin/date
echo -e "\nHere is the table of all the syndicate numbers ...\n"
/bin/cat -n "/home/foo/lottery.txt"
echo -e "\nWinning numbers :\n"
/bin/cat "/home/foo/winhope.txt"
echo -e "\nMatching lines :\n"
/bin/grep -nof "/home/foo/winhope.txt" "/home/foo/lottery.txt"


From what I can see, it might taking the '.' as something other than
part of the name of the file. Maybe enough quotes will fix it up?

Also, to keep from having to do a 'sh lot' on this to run it, you should
be able to do a 'chmod +x lot' and then only have to type in './lot'

And, being rather obvious here, but /home/foo/*.txt does have the proper
permissions for the remotely logged in user, right? (you never know.. I've
missed much easier stuff) :P

I tried it both ways through putty and both times it worked just fine...

--
Hayley
(shooting at straws from miles away)

leave one dot to email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 02-19-2008, 03:04 PM
Hayley Wesson
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

On Fri, 27 Aug 2004 04:25:10 -0500, Hayley Wesson wrote:
<chopslash>
Bah, then I do a refresh and the rest of the freakin thread shows up...

I see it's fixed already... Never mind... :P

--
Hayley
(better late than never?)

leave one dot to email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 02-19-2008, 03:04 PM
Kleeb
 
Posts: n/a
Default Re: 'lot'-a-trouble ...

On 2004-08-27, Hayley Wesson <h.o.t.w.i.r.e.7.5@yahoo.com> schrieb :
> On Fri, 27 Aug 2004 04:25:10 -0500, Hayley Wesson wrote:
><chopslash>
> Bah, then I do a refresh and the rest of the freakin thread shows up...
>
> I see it's fixed already... Never mind... :P
>


Hey Hayley, thanks for your input anyway.

Cordially,

Kleeb.
--
Remove the obvious gimp to email.
Registered Linux (conf)User 365031
Unregistered Windows Clicker 0x000000E3
'I am just going outside and may be some time.' - Lawrence Oates (1880-1912).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:44 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com