Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 11-07-2008, 09:52 AM   #1
Registered: Nov 2008
Distribution: Linux Mint
Posts: 56

Rep: Reputation: 17
can a tty execute command on another tty?

there's many ways to do things-I'm wondering if this is a valid avenue to solve mine. I'm running fdupes on my duplicate music files and come up with 6xxx dupes. *sigh* I used the -d command to prompt for deletion so now the tty it's running in asks me to press 1 for each dupe. I found I can open another tty and type
'echo "1" > /dev/pts/4'
and the 1 will show up on the other tty. is there a way to make that term send that to the process (make it execute)? or is there a way to pass that character directly to the process? my ultimate goal is to write a script that will put the 6xxx 1's in there for me. Thanks guys!
Old 11-07-2008, 11:01 AM   #2
LQ Newbie
Registered: Nov 2008
Posts: 5

Rep: Reputation: 0
My understanding is, you want to automate the manual process of giving input to the fdupes process.

just create a file with the required number of 1's in it.

for i in `seq 1 6xxx` ; do echo 1 > /tmp/file ; done

"your fdupes command" < /tmp/file

By using the "<" indirection operator you can give input to the process using a file.

i hope this solves ur problem.
Old 11-07-2008, 12:00 PM   #3
Registered: Sep 2008
Distribution: Slackware & Ubuntu
Posts: 39

Rep: Reputation: 15
to append to /tmp/file you will want to use "echo 1 >> /tmp/file" instead of "echo 1 > /tmp/file"
Old 11-08-2008, 09:39 AM   #4
Registered: Nov 2008
Distribution: Linux Mint
Posts: 56

Original Poster
Rep: Reputation: 17

You guys are the snizzznittlekabangabob!
On a real tip-THANKS!!!! It has worked and saved me from losing even more hair off of my head. A thousand thank yous! :-)
Gaurav/Lukav you guys are the BEST!!


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
is there a way to switch to a tty with a command? sh0 Linux - Software 3 12-17-2009 08:26 PM
How to reset/restart a tty from another tty? armandino Linux - General 4 02-25-2009 03:09 AM
I it possible to kill a tty or find which tty is being using by which process? geletine Linux - Software 2 01-15-2006 08:40 AM
change tty => system crashes (ati driver/tty resolution) mosca Debian 6 08-05-2004 07:37 AM
command to get tty number D. Marowa Linux - General 5 06-06-2004 07:47 PM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 10:22 AM.

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