> henry wrote:
> Often I made a long command, then I found it's useful ,
> I hope to cut it from screen to a shell script ,say my.sh .
> I usr lots of ways to try it (say, as follows).
> > echo  "cd /usr/src/linux/arch..........."    >         my.sh

The above will work fine. It will overwite whatever was in my.sh before
or create my.sh if it didn't alread exist. If you use:
        echo "more suff" >> my.sh
then "more stuff" will be appended to the end of my.sh

1. Remember my.sh have #!/bin/sh as it's first line.
ie:
        #!/bin/sh
        # This is my script for blah blah blah....
        cd /usr/src/linux/arch...........

2. Remember that my.sh needs to be made executable to run
$ chmod u+x my.sh       (make it executable)
$ ./my.sh               (run it)

The other way to cut from the screen if you are using X Windows xterms
is to use the mouse to select the text and paste the info into an editor
using the middle mouse button. That pastes in the text. Save the file as
my.sh

Also Henry, use a descriptive subject for your email like "How to get
text from screen into a shell"
rather than "ask a silly question". 
Mike
-- 
--------------------------------------------------------------------
Michael Lake
University of Technology, Sydney
Email: mailto:[EMAIL PROTECTED] Ph: 02 9514 1724 Fx: 02 9514 1628 
Linux enthusiast, active caver and interested in anything technical.
--------------------------------------------------------------------
-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to