Multiple argument scripts .....

hi there guys:
---------------
i want to know how to write a script where i have to give multple arguments that are not at start up :
for example if i want to write a script for c-shell to operate emacs its simple i write : (c-shell "emacs") /or creates a file opening emacs and just calling the prog.
but i f i want to use the "wall" option or the "write" option ... how do i do it?
to operate the wall i write : (c-shell "wall")
and than i must press enter and than to write the data and at the end ^d (ctrl+d) .
here i'm stuck ,please help me how do i do it.
doron123Asked:
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.

ahoffmannCommented:
either write your data (all the text excluding the ^d) into a seperate file and then call your script as follows:

    script <data_file

or you may use in your script, something like:

    cat <<'EndOfText' | your_desired_command
here comes your text
and so on ..
EndOfText

The literal `EndOfText' **must** not appear as first word in your text, 'cause it terminates your text. If you want to use wildcards and (shell)variable substitution in your text use the literal  `EndOfText'  without the quotes.
0

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
doron123Author Commented:
Thanks it works!!!! .
one thing more on this issue ..
when i write ^d or EndOfFile ,its shown on the screen and then! it terminates .. is there any option to not show it ..
like in dos @<argument> ,and then your command is not written?

is there any tool that can compile a script to run (like exe or com file so that not anyone can see its contant?

0
ahoffmannCommented:
If you use my 1'st solution (script <data_file), the data_file does not contain  EndOfText  nor  ^d.
((-: UNIX knows where a file ends: when there are no more chars :-))
So these should not be seen on the screen.

If you use my 2'nd solution, you must redirect stdout and/or stderr, this gets tricky for this example.

compile? Of cource: write it in any language of your desire (ada, C, C++, COBOL, FORTRAN, PASCAL, ...) and compile it.
There's no way to compile a script. The only solution I know is to crypt the script anyhow and use a wrapper which decrypt's it and then executes; any language solution would be more efficient.
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

doron123Author Commented:
last thing .. i run a program of "Ami" ,which is long and does a lot of things that takes time ,i want to write each proccess that ends sends a remark (for it endividualy).... so the file solution is complicated .. isn't there any other solution to write the "Wall" and "write" without the file but to enter them with the same line ... like "write doron-a <text> "???

0
ahoffmannCommented:
"Ami"? I don't know that.

I've not understood what you want to do exactly, need to know the context.
Give me some more info (may be your current script).
I'm shure that I find  a solution and then charge you for the points :-)
0
doron123Author Commented:
ok ...
it goes :
(in-pack "access")
(map "netlist name")
<here i want at the end of this proccess to write")
(c-shell "write <username> <text>")
i.e
(c-shell "write doron-a mapping stage finished")

there are alot of proccessed like here ,and i can't write a global scritp for this cause ,since each project is in an other directories ,and if i want to send it to the company than i don't want them to have too many files (it won't work) ,i want to write as in the example here in one line the content ,or if no other choise ,is there an option of having one file and telling in the script to write each time only some line that i will choose (i.e (c-shell "write doron-a line2>file_name")
meaning having one file with all the lines i want and telling in the script each time what line to write .

p.s.
-----
the script i sent you two lines from the first one is meaningless to you the secong is the begining of a stage in the entire process .. (meaningless here as well) .
the third line is what i want to add to the script (c-shell of course means use the c-shell commands).
0
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
Unix OS

From novice to tech pro — start learning today.