Copy code from shell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copy code from shell
# 1  
Old 10-12-2006
Copy code from shell

Hi everyone.. I'm a full-fledged newbie so bear with me. =)

I'm running code in the shell, and I'd like to copy the lines into a text file. Everytime I try using Contrl-C, the lines repeat as code. Is there some sort of export history function I can use?
# 2  
Old 10-12-2006
1) you can copy history from history file (e.g. if you use bash shell it will be ~/.bash_history)
2) if you use xterm (or gnome-terminal, etc.) just select block of text with mouse and it will be stored in the buffer
3) see bash(1) (or corresponding man for your shell), section 'Killing and Yanking'
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to copy files from on folder to another

I am trying to copy files with specific date and name to another folder. I am very new to shell scripting so i am finding it hard to do that. see the sample code i have written below. srcdir="/media/ubuntu/CA52057F5205720D/Users/st4r8_000/Desktop/office work/26 nov"... (13 Replies)
Discussion started by: Aqeel Abbas
13 Replies

2. Shell Programming and Scripting

Need help with script to copy code to multiple servers

Hi, I am new to scripting and i am trying to use below script to copy code to multiple servers and multiple locations on each server. the script is not working or doesnt give any error. Any help is appreciated. basically i want a script to get the code from a location (dir below) and read the... (2 Replies)
Discussion started by: Ron0612
2 Replies

3. Shell Programming and Scripting

Copy-pasted code behaves diffrent

Heyas I'm currently attempting to apply the code of tui-select to tui-list. That is because tui-list simply made a 1 string list, while tui-select uses dynamicly up to 3 strings per line. Anyway, so i copy pasted the code, and just made the changes marked with red.... Know that both scripts... (2 Replies)
Discussion started by: sea
2 Replies

4. UNIX for Dummies Questions & Answers

Help with Copy Shell Script

Hello, I am currently learning UNIX scripting and have written a simple copy program. However, upon execution, it returns an error despite debugging correctly. Can anyone assist in explaining this? Attached screenshots illustrating a test execution. Many thanks. (13 Replies)
Discussion started by: dixer
13 Replies

5. Shell Programming and Scripting

Shell script to copy file

Dear all, I have a database with thousands of files with the structure of name is: Filename_hour_year.abc Filename_hour_year_1.abc .............. So what I need is how to write a script that all file with contain the character "_1" will copy to "_2" For example: file name:... (7 Replies)
Discussion started by: hainguyen1402
7 Replies

6. UNIX for Advanced & Expert Users

Copy interactively - shell input

Hello, I am making a script to copy files interactively from one directory to another using the "i" option because I dont want to overwrite the files. cp -i *.html ./../otherdir/ cp: do you want to overwrite (y/n) ? I used cp -i *.html ./../otherdir/ ans='n' read $ans ... (4 Replies)
Discussion started by: telecomics
4 Replies

7. Shell Programming and Scripting

How to run a new shell with copy of current shell declarations?

How to run another shell and have all current shell dectaration copied to that new shell? I would like to have available all current declarations in a new shell. That are functions, aliases, variables. I need to test some functions that use the 'exit', but running it in current shell on... (9 Replies)
Discussion started by: alex_5161
9 Replies

8. Shell Programming and Scripting

How to get copy buffer in shell?

Hi, I need to save content of the copy buffer to file. I can open a text editor, paste it and save it. But I want to do it in script because I will do other actions with this file. Is there any opportunity to it from shell? I'm using Solaris 9. (0 Replies)
Discussion started by: kwama
0 Replies

9. UNIX for Dummies Questions & Answers

Copy code to vi

Hi, whenever I copy a code to vi session from other script it just goes weird. It just goes across the whole screen and looks really bizzare If the code is small I can manually remove the tabs and indent it correctly but if it is 2000 lines it makes it really difficult. Is there something... (12 Replies)
Discussion started by: rooh
12 Replies

10. UNIX for Dummies Questions & Answers

file copy thru sash shell

I accidentally assigned a password to the root user on this system and I don't remember what it was.. I was messing around with commands trying to learn the OS. I have an old Indy R5000 system and I do not have a working cd drive for it to run the irix installation. I booted into the PROM... (6 Replies)
Discussion started by: Qubbe
6 Replies
Login or Register to Ask a Question