LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2012, 10:11 PM   #1
malak33
Member
 
Registered: Dec 2011
Location: Amish Country PA, USA
Distribution: CentOS 6.2
Posts: 104

Rep: Reputation: 3
Copy and paste in bash shell???


Ok so here is my problem. Let's say I'm in shell 1 and i have open /boot/grub/grub.conf and in shell 2 i have a command ran like this
grub-m5-crypt
then i enter in my password and it spits this out at me
laskdjhfKHFIU98&y8KDJHF6576*&(*&)(*KJHB#Gy22(*#*Yiho0234hj..nih23i4h
(exageration)

Now back in shell 1 i inserted the following line password --md5 (i need super long hashed password here)

How do i go about copying the output from shell 2 and making it so i can paste in shell 1.

I know that if i open up the GUI i can just open up terminal and copy and paste that way. I do not want to use the GUI. I used it at first to get comfortable, i feel like I'm almost there now. Thanks for the help guys. Ohh yea I'm using CentOS 6.2 as well.
 
Old 05-10-2012, 10:20 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
Install gpm, when it runs you can mark text with the mouse and paste it everywhere with a middle mouse click.
 
Old 05-10-2012, 10:21 PM   #3
malak33
Member
 
Registered: Dec 2011
Location: Amish Country PA, USA
Distribution: CentOS 6.2
Posts: 104

Original Poster
Rep: Reputation: 3
i do not have a mouse in my shell...
 
Old 05-10-2012, 10:22 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
You will when you have installed gpm. gpm is something like a mouse driver for the console.
 
Old 05-10-2012, 10:31 PM   #5
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,462

Rep: Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369
You could also use a temporary file. e.g.
echo "$(grub-md5-crypt)" > temp.txt
and then read in the contents of temp.txt from the editor you are using for the /boot/grub/grub.conf
 
Old 05-10-2012, 10:55 PM   #6
malak33
Member
 
Registered: Dec 2011
Location: Amish Country PA, USA
Distribution: CentOS 6.2
Posts: 104

Original Poster
Rep: Reputation: 3
i don't understand how that would get the super long password into the grub.conf file that i have open in a text editor though? it would copy it to a temp .txt document. How does it get from the temp.txt doc to the grub.conf file that i have open?
 
Old 05-11-2012, 08:14 AM   #7
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,462

Rep: Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369
If you use 'nano' look at Ctrl-R. If you use 'vim' look at :r.
 
Old 05-11-2012, 09:59 AM   #8
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 289
Blog Entries: 1

Rep: Reputation: 41
if you use graphic shaell like xterm kterm etc you have clipboard by default(sometimes ctrl+cvx don't work, use shift/crtl+ins/del)
if you use 'bare' shell with no X11 you need a way around like shared file etc.. or package 'console' that have a lot of good stuff buildin (like resume shell session from anywhere,forks,spoons etc..)
my little stuff include things like whattty=$(tty);echo 'All your bases belong to us\n Borg' >> $whattty;
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy/paste output from shell (not terminal) bluegospel Linux - Newbie 13 07-21-2010 02:37 PM
Copy-paste in the shell fuzzyBuzz Linux - Newbie 11 07-08-2007 02:12 PM
shell type vs copy paste gr00ve Linux - General 8 03-31-2006 03:38 PM
how to copy and paste between text editors sessions in bash pxes351 Linux - Newbie 2 05-06-2004 07:59 AM
Copy Paste in shell Zolan Linux - Newbie 1 03-29-2004 11:41 AM


All times are GMT -5. The time now is 12:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration