Hot Topic (More than 10 Replies) Problems with @shell command (Read 1933 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Problems with @shell command
Jun 2nd, 2004 at 6:11pm
Print Post Print Post  
I'm having trouble using the @shell command with a long string of data that contains spaces or symbols such as "&" or "?".

Using Alec's example program for launching a website in IExplorer, I cant get a long complicated site to load. The below site is an example:

LE named URL Contains:

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&category=39721&item=3914338132&rd=...

Shouldn't wrapping the string in quotes take care of the odd characters:

IEWebsite = @chr(34) + URL + @chr(34)

If I paste the @shell output from the Writeln window, into the Start/Run button, it works everytime.

Thanks,

Steve in Texas
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Problems with @shell command
Reply #1 - Jun 2nd, 2004 at 6:15pm
Print Post Print Post  
I'd need to see the whole thing to spot the problem. Does anything at all happen? Does IE start, but not load the right page?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Problems with @shell command
Reply #2 - Jun 2nd, 2004 at 6:25pm
Print Post Print Post  
IE launches and trys to load the site, but only gets about halfway through the URL. Then IE gives an error box saying the website could not be found. (Like its gets to the "?" in the URL then chops off the last part)

I'm having the same problem trying to launch a photo editor with a long filename (also wrapped in quotes). Seems like long strings are not getting through to the program that is being launched.

You can try this button in the app I sent you last night.

In the form called Category Editor there is a blue button labeled "Go To Product". Just paste a long website into the "Link" Feild, or do a search for a non-empty Link feild, then hit the button.

Thanks,
Steve in Texas
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Problems with @shell command
Reply #3 - Jun 2nd, 2004 at 7:52pm
Print Post Print Post  
Your URLs contain an ampersand. The ampersand (&) is a reserved character on a command line. It separates multiple commands. In order to do this, you need to put a carat (^) before each ampersand. This will tell the operating system not to interpret the ampersand as a command separator.

http://66.216.107.41/index.asp?PageAction=VIEWPROD^&ProdID=5806
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Problems with @shell command
Reply #4 - Jun 2nd, 2004 at 7:59pm
Print Post Print Post  
Thanks Erika,

This may help with my other @shell commands not working, also (maybe some of our photo filenames have reserved characters, also.)

Can you tell me where I can go to learn more about these reserved characters so I don't waster your time in the future?

We do a lot of exporting/importing in Sesame and are having problems with reserved characters such as double quotes, backslash, and now this one. I'm sure we'll bump into more very soon.

Should I just search google for "windows OS reserved characters", or DOS reserved characters?

Thanks,

Steve in Texas
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Problems with @shell command
Reply #5 - Jun 2nd, 2004 at 8:06pm
Print Post Print Post  
In this case, I pasted the relevant command onto a command line and ran it. The error:

'ProdID' is not recognized as an internal or external command

told me that the ampersand was the problem. I then went out on Google and looked up how to escape it.  Smiley


FYI: If it's not a letter, a number or an underscore, it's likely to be trouble.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Problems with @shell command
Reply #6 - Jun 2nd, 2004 at 8:13pm
Print Post Print Post  
Oh, sorry. I thought I tested it on a command line (Start>Run) and had success. I guess I was confused.

I'll research it more on my own since its not a Sesame issue.

Thanks,

Steve in Texas
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Problems with @shell command
Reply #7 - Jun 2nd, 2004 at 8:20pm
Print Post Print Post  
If you find out more - please share. While it is not directly a Sesame issue, it is certainly relevent to Sesame users.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Problems with @shell command
Reply #8 - Jun 2nd, 2004 at 8:24pm
Print Post Print Post  
Will do!

Thanks again,

Steve in Texas

  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Problems with @shell command
Reply #9 - Jun 2nd, 2004 at 8:25pm
Print Post Print Post  
I suppose that the question isn't what is significant to the command line, but how to "escape" or "literalize" the characters that are significant to the command line.

On WIn32:
< > | . & * - \ / ^

are significant.

I know Linux shells add:

[ ] ( ) % $ ~ ; ?

to the list.

That pretty much leaves (as Erika points out) letters and numbers.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Problems with @shell command
Reply #10 - Jun 2nd, 2004 at 8:34pm
Print Post Print Post  
I thought that if you just put double quotes around these characters, you could get around these problems.

I learned this when we bought Win 2000 and I had trouble with a batch file:

Copy c:\q&a\inven.db d:\backup\inven.db

The solution was easy

Copy "C:\q&A\Inven.db" "d:\backup\inven.db"

The double quotes solved the problem. But in sesame, adding @chr(34) before and after the "link" or "URL" string, doesnt seem to work.

Steve in Texas
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Problems with @shell command
Reply #11 - Jun 2nd, 2004 at 8:56pm
Print Post Print Post  
Quotes work for some things. Not for others.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged