restart process

My program gives me an error message when executing:
$ cd /s/path/Lev#  ./sas.server stop
$: command not found

Here is my
#!/bin/ksh

$ cd /s/path/Lev#  ./sas.server stop
dfn48Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Remove the $ and the space following it.
Gerwin Jansen, EE MVETopic Advisor Commented:
And add a semicolon ; between the cd and sas command
Daniel McAllisterPresident, IT4SOHO, LLCCommented:
You DO understand that typing

cd /s/path/Lev#  ./sas.server stop
is the same as typing

cd /s/path/Lev
because the # symbol is a shell meta-character for "comment"....

assuming your script is located in the folder /s/path/Lev, and is called sas.server, and that you want to send it the command line argument of stop... the correct command line would be:

$ /s/path/Lev/sas.server stop -- with NO $ in the front (that's the prompt)
On a couple of side notes:
if it is important that the script be run with a CWD of /s/path/Lev, then the command line would be
$ cd /s/path/Lev ; ./sas.server stop -- with a SEMI-COLON
if the # is indeed part of the folder or file name, you will have to "escape" it with a \
Perhaps: $ cd /s/path/Lev\# ; ./sas.server stop -- with a SEMI-COLON

I hope this helps

Dan
IT4SOHO

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Joseph GanSystem AdminCommented:
Why don't you just using one line:

$ /s/path/Lev/sas.server stop
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.