ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Right now I have the following questions:
1) Why I can successfully log on the server without typing the password?
2) Why I can't
cp /home/username
mkdir src/
after I am on the server?
It seems the actions written within my local scripts have no effect on the server. How to solve this problem?
Or is this bash's nature? If so, are there any other script language can make it?
When you use a script to rsh to a remote host, your local shell process waits until the rsh command completes. What you are seeing at your console is the output from rsh, which is getting its input from the output of the process which is running on the remote host.
If you want to execute a series of commands on the remote host, you have a couple of options:
1. Create a shell script and transfer it to the remote host, and then have rsh invoke that script as its command argument (man rsh).
2. Use something such as expect (man expect) to issue command strings according to some scripted plan.
3. A scriptable terminal emulator such as C-Kermit may be able to perform the rsh and respond to feedback from the remote host.
--- rod.
When you use a script to rsh to a remote host, your local shell process waits until the rsh command completes. What you are seeing at your console is the output from rsh, which is getting its input from the output of the process which is running on the remote host.
If you want to execute a series of commands on the remote host, you have a couple of options:
1. Create a shell script and transfer it to the remote host, and then have rsh invoke that script as its command argument (man rsh).
2. Use something such as expect (man expect) to issue command strings according to some scripted plan.
3. A scriptable terminal emulator such as C-Kermit may be able to perform the rsh and respond to feedback from the remote host.
--- rod.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.