LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   cutting and pasting (https://www.linuxquestions.org/questions/linux-general-1/cutting-and-pasting-82821/)

lxandrthegr8 08-17-2003 09:42 AM

cutting and pasting
 
:newbie:
This is definitely a newbie question. How can you make it easier to cut and paste using the "How to" to actually paste them into the terminals.
Sorry for such a simple question but I've tried to do it several different ways.
Some programs will let you cut and paste into them, others will not.
Thanks in advance

koyi 08-17-2003 09:51 AM

If you are using a mouse with 3 buttons. You simply have to select the text to copy(ya, only select it and nothing else), click the middle button to paste. If you are using a 2-button mouse, try clicking on both buttons at the same time. If this doesn't work you will have to set emulate-3-button-mouse in your X config file. Try to do a search on it.

Hope you have a 3 buttons mouse :)

david_ross 08-17-2003 09:56 AM

Copy: Ctrl + Ins
Paste: Shift + Ins

lxandrthegr8 08-17-2003 10:38 AM

No that is not what I'm asking. I want to know how to paste a script found in the "How to..." text into the terminal window. When I attempt to do so each line will be run thereby giving me error messages. I want to load the entire script to run. Am I missing something here?

Mathieu 08-17-2003 10:45 AM

Copy the text into a text editor and then save it as a file.

If you are getting errors, the script was most likely written for another shell.
By default, most Linux distribution use the Bash shell.

david_ross 08-17-2003 10:52 AM

remeber to give yourslef execute permissions on the script too. Look at chmod - "man chmod"

lxandrthegr8 08-17-2003 01:02 PM

Thanks again Mathieu, but now - how do I paste that file into the terminal window? If it is the Bash shell, what are the major differences?

Mathieu 08-17-2003 01:44 PM

You need to make the file executable.

In the terminal, go in the directory where you saved the file.
You can use the cd command to change directory and the ls command to list the contents of a directory.

When you are in the directory with the file, use chmod to set the permissions to executable.
Code:

chmod 755 myScript
To execute the script, type:
Code:

./myScript
If you want to know for which shell your script was written, look at the first line of the script.
For example, if it is Bash, the syntax should be something like this #!/bin/bash

lxandrthegr8 08-17-2003 02:04 PM

Thanks once again Mathieu


All times are GMT -5. The time now is 03:23 PM.