Problem with .sh & .cgi files created in Windows - SOLVED

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
User avatar
offbeatdave
Posts: 1045
Joined: Wed Mar 09, 2011 10:43 pm

Problem with .sh & .cgi files created in Windows - SOLVED

Post by offbeatdave »

I'm having problems when modifying .sh and .cgi files in windows and uploading them to the joggler through WinSCP.

Basically when I've uploaded the files (created or edited in Notepad++) they will not execute unless I open the version on the Joggler through WinSCP and resave it directly to the Joggler.

I have tried the following:
Create the file in Windows using Notepad++
Upload to the Joggler inWinSCP
Change permissions in WinSCP to full control
or use chmod to change permissions

but the file "is not found" when I try to run in in putty etc.

As I say, if I then open the file from the joggler in WinSCP and save it then they run fine in terminal.

Am I missing something obvious here?
Last edited by offbeatdave on Sat Sep 24, 2011 12:38 am, edited 1 time in total.
"EVERY DAY I'M JOGGLERING!"
Jogglering since Dec '09;
Tinkering with Jogglers since Feb '10 thanks to PMJ, Jogtools, PnP & sqpOS;
Gave something back Feb '12 to Apr '14 with PnP Mk II & PnP III;
Finally 'completed' PnP III Apr '15!
User avatar
offbeatdave
Posts: 1045
Joined: Wed Mar 09, 2011 10:43 pm

Re: Problem with .sh & .cgi files created in Windows & uploa

Post by offbeatdave »

Hmm. It looks like saving them in standard Notepad app (Windows XP) and then transferring them may work...testing now...
"EVERY DAY I'M JOGGLERING!"
Jogglering since Dec '09;
Tinkering with Jogglers since Feb '10 thanks to PMJ, Jogtools, PnP & sqpOS;
Gave something back Feb '12 to Apr '14 with PnP Mk II & PnP III;
Finally 'completed' PnP III Apr '15!
moka
Posts: 34
Joined: Thu Apr 14, 2011 2:36 am

Re: Problem with .sh & .cgi files created in Windows & uploa

Post by moka »

Could be something to do with line breaks being different in unix and windows? Not sure.... Or are you forgetting unix files are case sensitive?

Would it be possible for you to upload some of the icons i see in your avatar or let me know where you got them from? I have another thread asking somewhere.
User avatar
offbeatdave
Posts: 1045
Joined: Wed Mar 09, 2011 10:43 pm

Re: Problem with .sh & .cgi files created in Windows & uploa

Post by offbeatdave »

I think it is a compatibility issue between unix and windows. Any advice as to how I should be editing files before uploading them? Should I be using Ubuntu etc to do this rather than Windows?
"EVERY DAY I'M JOGGLERING!"
Jogglering since Dec '09;
Tinkering with Jogglers since Feb '10 thanks to PMJ, Jogtools, PnP & sqpOS;
Gave something back Feb '12 to Apr '14 with PnP Mk II & PnP III;
Finally 'completed' PnP III Apr '15!
spoyser
Posts: 134
Joined: Mon Mar 07, 2011 6:45 pm

Re: Problem with .sh & .cgi files created in Windows & uploa

Post by spoyser »

When you do the transfer in WinSCP hit the "Transfer Settings..." button on the "Copy" dialog and select Binary.

HTH
User avatar
offbeatdave
Posts: 1045
Joined: Wed Mar 09, 2011 10:43 pm

Re: Problem with .sh & .cgi files created in Windows & uploa

Post by offbeatdave »

Thanks - will try this later!
"EVERY DAY I'M JOGGLERING!"
Jogglering since Dec '09;
Tinkering with Jogglers since Feb '10 thanks to PMJ, Jogtools, PnP & sqpOS;
Gave something back Feb '12 to Apr '14 with PnP Mk II & PnP III;
Finally 'completed' PnP III Apr '15!
User avatar
offbeatdave
Posts: 1045
Joined: Wed Mar 09, 2011 10:43 pm

Re: Problem with .sh & .cgi files created in Windows - SOLVE

Post by offbeatdave »

All sorted I think thanks to posts above. Set Tansfer to Binary in global settings for WinSCP. Also, as precaution, when saving, set file type to .sh before saving as a .sh or .cgi in Notepad++

Anyway, can now upload, download and, after setting permissions, running scripts using ./<PATH>/<SCRIPT>.sh works as it should!

It's taken a week to do, but I've successfully modded the very clever PnP stuff to install and remove my chosen apps on the Joggler OS desktop (Opera, iPlayer, YouTube with own tabs, Squeezeplayer with Squeezeserver and iPlayer plugins, Google Maps, OP Weather, Google Calendar, a timer, a stopwatch, the OP Horoscopes, SWF manager, Restart Tango, ScreenOFF, o2 Memos, o2 Calculator, OP Dilbert, OP News, o2 Alarm, OP clock screensaver and my custom icons and radio stations) on a clean, networked image in just under 15 minutes from my own filespace without me having to raise a finger other than to network a clean image first and then plug in the USB stick to start the process!

I'm sure most of you could have done this without breaking sweat but, as always, I've learned a lot from the journey!
"EVERY DAY I'M JOGGLERING!"
Jogglering since Dec '09;
Tinkering with Jogglers since Feb '10 thanks to PMJ, Jogtools, PnP & sqpOS;
Gave something back Feb '12 to Apr '14 with PnP Mk II & PnP III;
Finally 'completed' PnP III Apr '15!
spoyser
Posts: 134
Joined: Mon Mar 07, 2011 6:45 pm

Re: Problem with .sh & .cgi files created in Windows - SOLVE

Post by spoyser »

Glad to help!

Did you install the latest YouTube player (v1.2), the one that uses the Little App Launcher to install?
User avatar
offbeatdave
Posts: 1045
Joined: Wed Mar 09, 2011 10:43 pm

Re: Problem with .sh & .cgi files created in Windows - SOLVE

Post by offbeatdave »

Yes, installed latest YouTube player thanks and it is working very smoothly! I must read the notes to learn what the buttons do!
"EVERY DAY I'M JOGGLERING!"
Jogglering since Dec '09;
Tinkering with Jogglers since Feb '10 thanks to PMJ, Jogtools, PnP & sqpOS;
Gave something back Feb '12 to Apr '14 with PnP Mk II & PnP III;
Finally 'completed' PnP III Apr '15!
Post Reply