LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-08-2012, 11:08 PM   #1
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Rep: Reputation: 85
Linux+ Cert Practice Question


Quote:
You want to run an interactive script, gabby, which produces a lot of output in response to the user's inputs. To facilitate future study of this script, you want to copy its output to a file. How might you do this?

gabby > gabby-out.txt

gabby | tee gabby-out.txt

gabby < gabby-out.txt

gabby &> gabby-out.txt
I don't have an interactive script that I know of, so i decided to use gpg --gen-key because it's interactive. The last command captured the stderr, but not the stdout.


Code:
203/3954MB      0.98 1.07 1.05 3/492 19386
[19065:2023 0:301] 11:15:15 Fri Jun 08 [bull@beastlinux: +2] ~ 
(2:301)$ gpg --gen-key > /tmp/gabby-out.txt
gpg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 
gpg: Interrupt caught ... exiting

202/3954MB      1.05 1.08 1.05 1/492 19392
[19065:2023 0:302] 11:15:23 Fri Jun 08 [bull@beastlinux: +2] ~ 
(2:302)$ cat /tmp/gabby-out.txt 
202/3954MB      1.05 1.08 1.05 1/492 19398
[19065:2023 0:303] 11:15:26 Fri Jun 08 [bull@beastlinux: +2] ~ 
(2:303)$ gpg --gen-key | tee /tmp/gabby-out.txt
gpg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 
gpg: Interrupt caught ... exiting

200/3954MB      1.11 1.10 1.05 1/492 19407
[19065:2023 0:304] 11:15:36 Fri Jun 08 [bull@beastlinux: +2] ~ 
(2:304)$ cat /tmp/gabby-out.txt 
182/3954MB      1.24 1.13 1.06 1/492 19414
[19065:2023 0:305] 11:15:50 Fri Jun 08 [bull@beastlinux: +2] ~ 
(2:305)$ gpg --gen-key &> /tmp/gabby-out.txt
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 
176/3954MB      1.41 1.17 1.08 1/490 19420
[19065:2023 0:306] 11:16:01 Fri Jun 08 [bull@beastlinux: +2] ~
(2:306)$ cat /tmp/gabby-out.txt 
gpg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


gpg: Interrupt caught ... exiting
176/3954MB      1.29 1.15 1.07 1/490 19426
[19065:2023 0:307] 11:16:06 Fri Jun 08 [bull@beastlinux: +2] ~ 
(2:307)$

Last edited by fakie_flip; 06-08-2012 at 11:19 PM.
 
Old 06-09-2012, 12:16 AM   #2
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Rep: Reputation: 107Reputation: 107
edit: misread part of the question. Ignore me.

Last edited by Cultist; 06-09-2012 at 12:17 AM.
 
  


Reply



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
Error: Can't read cert file /etc/pki/tls/certs/cert.pem in Twiki jsaravana87 Linux - Server 1 09-09-2011 06:01 PM
Question for hand on practice pawansingh Linux - Newbie 2 11-23-2010 05:12 AM
Dovecot SSL cert question Archer36 Slackware 1 11-26-2006 04:03 PM
Best Practice Question zuessh Linux - Security 3 05-02-2003 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:46 PM.

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
Open Source Consulting | Domain Registration