Solved

Multiple argument scripts .....

Posted on 1997-10-09
6
228 Views
Last Modified: 2010-04-21
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.
0
Comment
Question by:doron123
  • 3
  • 3
6 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 2007220
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
 

Author Comment

by:doron123
ID: 2007221
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2007222
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:doron123
ID: 2007223
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2007224
"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
 

Author Comment

by:doron123
ID: 2007225
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now