Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Plz Help : How to use write command to execute command on some other terminal Post 101008 by matrixmadhan on Friday 3rd of March 2006 07:40:37 AM
Old 03-03-2006
your commands or sequence of characters would be interpreted only as messages to be executed by write command on a particular tty

even if you try,
Code:
echo "ls" > /dev/pts/3

it would be taken only as a message to tty-3 and not as a command
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Urgent!! How to write a shell program to execute command to access internet?

hi, I am new ot unix. So, can i write a shell(c shell or korn shell) program to access internet? I mean if I run the program, it can access specified url and then copy the html to a file? Can anyone help me? And how can make the program runs every 1 hr? new comer (2 Replies)
Discussion started by: firebirdonfire
2 Replies

2. UNIX for Dummies Questions & Answers

explain command plz

echo -n "1. Updating Password Policy in OID..." | tee -a $logfile set ldap_v1 = `ldapsearch -b "" -h $oid_host -p $oid_port -D "cn=orcladmin" -w $admin_pwd -s sub "cn=PwdPolicyEntry" dn | head -1` echo "dn:$ldap_v1" > ldap1.out echo "changetype:modify" >> ldap1.out echo... (2 Replies)
Discussion started by: maoro
2 Replies

3. Shell Programming and Scripting

Execute command from terminal on remote machine

Hi All, I want to execute some commands on unix machine from the mac machne. I have two options for doing so, I am confused which is the best way of doing. Here are two options. Requirement: Execute command on the remote server machine. Commands to be executed itself contain arguments to be... (0 Replies)
Discussion started by: Ranu
0 Replies

4. Shell Programming and Scripting

How to build a command into a string rather than execute the command

I'm trying to populate a command line into a variable. It appears to be executing, instead. Here's an example: mycmd='' if ...; then $mycmd='sudo ' fi $mycmd=$mycmd 'sed -i prev s/aaa/bbb/' $myfile res=`$mycmd` (I'm also not sure of the best way to execute the command from the... (1 Reply)
Discussion started by: littlejon
1 Replies

5. Shell Programming and Scripting

write a shell script to execute a command

Hello all, I have just started doing shell scripting. I want to read a file which stores the status of my job I have submitted on a cluster. The file looks something like this : ========================FILE============================= crab: Checking the status of all jobs: please wait... (4 Replies)
Discussion started by: learn_linux
4 Replies

6. Shell Programming and Scripting

Is command line invocation of gnome-terminal to run more than one command possible?

Hello, I am trying to learn how to pass something more than a one-command startup for gnome-terminal. I will give an example of what I'm trying to do here: #! /bin/bash # #TODO write this for gnome and xterm USAGE=" ______________________________________________ ${0##*/} run... (0 Replies)
Discussion started by: Narnie
0 Replies

7. UNIX for Dummies Questions & Answers

Need help with SED command plz

I need two solutions 1) How can i swap the first and last character in each line of file temp 2) How can i display content of the file using sed command Please help (2 Replies)
Discussion started by: champu
2 Replies

8. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

9. Shell Programming and Scripting

How to execute a command on each line of output from another command?

Hello :) new to bash not to programming. I have an on-going need to change the owning group on sets of files and directories from the one they were created with or changed to on update to the one they need to have going forward. find {target_root} -group wrong_group gets me a newline... (4 Replies)
Discussion started by: naftali
4 Replies

10. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
write(1)						      General Commands Manual							  write(1)

NAME
write - interactively write (talk) to another user SYNOPSIS
DESCRIPTION
The command copies lines from your terminal to that of another user. When first called, it sends the message: to the receiving user's terminal. When it has successfully completed the connection, it also sends two bells to your own terminal to indi- cate that what you are typing is being sent. To set up two-way communication, the recipient of the message (user) must execute the command: (yourterminal is only required if the originator is logged in more than once.) Communication continues until an end of file is read from the terminal, an interrupt is sent, or the recipient executes At that point, writes on the other terminal and exits. To write to a user who is logged in more than once, use the terminal argument to indicate which line or terminal to send to (e.g., Other- wise, the first writable instance of the user found in database is assumed and the following message is displayed: terminal ... Permission to write may be denied or granted with the command (see mesg(1)). Writing to others is normally allowed by default. Certain commands, in particular and disallow messages in order to prevent interference with their output. However, if the user has the appropriate privileges, messages can be forced onto a write-inhibited terminal. If the character is found at the beginning of a line, calls the POSIX shell (see sh-posix(1)) to execute the rest of the line as a command. The following protocol is suggested for using When you first to another user, wait for the user to back before starting to send. Each per- son should end a message with a distinctive signal (such as "" for "over") so that the other person knows when to reply. Similarly, the signal "" (for "over and out") can be used to indicate the end of the conversation. EXTERNAL INFLUENCES
Environment Variables determines the locale to use for the locale categories when both and the corresponding environment variable (beginning with do not specify a locale. If is not set or is set to the empty string, a default of "C" (see lang(5)) is used. determines the format and contents of date and time strings. determines the language in which messages are displayed. If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multi-byte character code sets are supported. DIAGNOSTICS
The user you are trying to write to is not logged on. Your correspondent has denied write permission after your session started. Your session is ended. Your correspondent sent end-of-file, or you set your terminal to and your correspondent tried to write to you. If you have a session established, you can continue to write to your correspondent. The user you are trying to write to has denied write permission (with Your terminal is set to and the recipient cannot respond to you. EXAMPLES
By issuing the command: user sends a message to user screen. If responds: two-way communication between and is established. FILES
To find user To execute shell commands SEE ALSO
elm(1), mail(1), mailx(1), mesg(1), nroff(1), pr(1), sh-posix(1), sh(1), who(1), utmpd(1M), getutsent(3C). STANDARDS CONFORMANCE
write(1)
All times are GMT -4. The time now is 04:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy