Difficulty using shell in Ubuntu Linux

Bob Warren robertum at brturbo.com
Tue Feb 21 15:26:38 EST 2006


Dear Tom,

I'm afraid I can't help you very much yet in relation to long file 
names. In the chooser widgets I have just developed for Linux Ubuntu (my 
first attempt), all long file names on the HD are respected with no 
trouble, and the folder/file names appear perfectly correctly in the 
widget HD trees as though it were Windows. To what degree this is a 
characteristic of Ubuntu Linux rather than some other Linux, or even 
Unix, sorry, but I don't have the knowledge to tell you. However, when 
it comes to reading/writing from/to diskette, folder/file names are 
reduced to 8 + 3 simply because the diskette format is that of DOS, and 
in my widgets this is no real problem.

Regarding the command lines and embedded blanks etc., I am doing nothing 
other than using the Runtime Revolution commands SHELL and LAUNCH. The 
2nd of these has the simplest format. You just have to give the command 
and then specify the path to the program to be executed. In Windows, 
this might be for example:

launch "c:\program files\getright\getright.exe"

Using RR SHELL is fundamentally only:

get shell("c:\program files\getright\getright.exe")

 From REVOLUTION itself (not messing about with system level command 
lines or anything like that), you can use exactly the same instructions, 
except that the file paths are specified differently using forward 
slashes. Although it is ficticious, the equivalent in Linux would be:

launch "/program files/getright/getright.exe" [but probably without ".exe"]
OR
get shell("/program files/getright/getright.exe") [but probably without 
".exe"]

These are perfectly valid file paths in Linux.

HOWEVER, in practice, I discovered that the commands above would not 
work because of the embedded blank between "program" and "files".

It seems that the paths for the launch/shell commands in RR have to obey 
the Unix convention rather than the Linux convention. The workaround is 
what Dave Cope (thank God) provided me with. All you have to do is 
replace any blanks in the program path with "\ " (i.e. \space). So 
"program files" becomes "program\ files", and what you need to specify 
in REVOLUTION is:

launch "/program\ files/getright/getright.exe" [but probably without ".exe"]
OR
get shell("/program\ files/getright/getright.exe") [but probably without 
".exe"]

Within the next few days, I will be publishing my (standalone) Chooser 
Widgets for Linux on the Internet, and, similar to the Windows version, 
I will be providing a demo call stack which will give you concrete 
examples of such (RR) shell calls.

That's the best I can do at the moment, I'm afraid. Hope it helps.

Regards,
Bob


Thomas McGrath III wrote:

> Bob,
>
> I am going to be dealing with the problem of spaces in file names  
> across platforms and also with the problem of file names being too  
> long in my project. Can you summarize what you have figured out (with  
> the help you have gotten). Do you have any sample code snippets?  
> stacks? or examples?
>
> I tried to follow but got lost somewhere. I know we are talking about  
> replacing " " with "\" but where do these work? in unix/mac/win from  
> a shell or command line or from REV path tools?
>
>
> Thanks
>
> Tom
>
>
> On Feb 21, 2006, at 1:10 PM, Bob Warren wrote:
>
>> Dear Stephen,
>>
>> Unfortunately, the decision whether to use spaces in folder/file  
>> names is something that is generally out of my hands. In Windows,  
>> they are used by all and sundry all the time, with absolutely no  
>> problem, and of course Linux progressively tries to follow similar  
>> standards in order to compete with Windows. Since I am producing  
>> software to work on other people's computers rather than my own, I  
>> need to take the use of spaces into account.
>>
>> But have no fear, Dave Cope has been here! His solution of using  
>> escape codes (i.e. "\ ") in command lines works like a charm, and  in 
>> RR programming terms (using REPLACE) it is very simple.
>>
>> Regards,
>> Bob
>>
>> Stephen Barncard wrote:
>>
>>> I don't think spaces in filenames or foldernames on any platform  is 
>>> a good idea.
>>> They don't work on my webservers either.
>>>
>>>  Too many platforms don't like them, especially on networks.  People 
>>> have gotten used to OS's that clean up after them but  filenames 
>>> just shouldn't have spaces! I've ingrained myself with  no-space 
>>> habits for years.  Use underscore in place of spaces.
>>> What do you do? Rename all the files with spaces!!
>>>
>>> sdqb
>>>
>>>
>>>> I now have an explanation as to why the shell in (Ubuntu) Linux  
>>>> seems to work sometimes, but not others: the HD path to the  
>>>> executable for launching MUST NOT CONTAIN BLANKS!
>>>>
>>>> For example, this works like a charm:
>>>>
>>>>   global myVar
>>>>   put "/home/bob/Desktop/folderwithnospaces/myprog" into myVar
>>>>   set the defaultFolder to "/home/bob/Desktop/folderwithnospaces"
>>>>   get shell(myVar)
>>>>
>>>> This doesn't work at all:
>>>>
>>>>   global myVar
>>>>   put "/home/bob/Desktop/folder with spaces/yourprog" into myVar
>>>>   set the defaultFolder to "/home/bob/Desktop/folder with spaces"
>>>>   get shell(myVar)
>>>>
>>>> Exactly the same thing applies to the LAUNCH command.
>>>>
>>>> Now what do I do?
>>>> Any ideas anyone?
>>>>
>>>> Bob
>>>>
>>>
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
> Thomas J McGrath III
> 3mcgrath at adelphia.net
>
> Lazy River Software™ - http://www.lazyriversoftware.com
>
> Lazy River Metal Art™ - http://www.lazyriversoftware.com/metal.html
>
> Meeting Wear™ - http://www.cafepress.com/meetingwear
>
> Semantic Compaction Systems - http://www.minspeak.com
>
> SCIconics, LLC - http://www.sciconics.com/sciindex.html
>
>
>
>
>
>
>
>
>
>





More information about the use-livecode mailing list