05-03-2011
Strange... do those directories on servers exist? Does the remote connection happen at all? Try rsh -v to switch on verbose mode.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi
I wanted to use the for loop structure in tandem with rsh command and the result to be redirected into a local .lst file within a shell script .
Tried the following but does not help :confused: .
rsh ABCD "cd /bosp/local/home/linus/;for i in `ls -ltr | grep ^- | awk {'print $9'}`
do... (4 Replies)
Discussion started by: newbee2005
4 Replies
2. Shell Programming and Scripting
Hey all
I have two scripts, one script containing the guts of my code.
The other simply loops through a list, calling the other script on each iteration.
Problem is when I add the line
`/usr/bin/rsh -l root $HOSTNAME ""`
to my main script, the loop never seems to exectute any more... (1 Reply)
Discussion started by: mark007
1 Replies
3. Shell Programming and Scripting
I am a newbie to awk and c programming, however am not a unix newbie. However, I do need help with a kshell script I am writing. It is almost complete, the last step is killing me. Any help would be greatly appreciated. What I am trying to do is cat a text file that has usernames. Then, using... (2 Replies)
Discussion started by: synergy_texas
2 Replies
4. Shell Programming and Scripting
Hi,
I've tried searching the forums for a case similar to mine but was unsuccessful. This is my first time to use awk so any help would be really appreciated :)
I have one file containing data for with the first value in each row being a State Name. I would need to create a separate file... (1 Reply)
Discussion started by: karver
1 Replies
5. Shell Programming and Scripting
Hi,
I have a text file with data in that I wish to extract, assign to a variable and process through a loop.
Kind of the process that I am after:
1: Grep the text file for the values.
Currently using:
cat /root/test.txt | grep TESTING= | awk -F"=" '{ a = $2 } {print a}' | sort -u
... (0 Replies)
Discussion started by: Spoonless
0 Replies
6. UNIX for Dummies Questions & Answers
Hi i have to insert the below line into a specific line number of another file
export MBR_CNT_PRCP_TYPE_CODES_DEL="'01','02','04','05','49','55','UNK'"
I have passed the above line to a variable say ins_line. I have used below command to perform the insert
awk 'NR==3{print "'"${ins_line}"'"}1'... (1 Reply)
Discussion started by: sathishteradata
1 Replies
7. Shell Programming and Scripting
Hello,
I'm having some issues getting a home dir from a remote server passed to a variable.
Here is what I have so far:
rsh server "(ls -ld /home*/user | awk '{print \$9}')"
/home3/userThat works fine and brings back what I need.
But when I try to add it to a variable it goes all... (3 Replies)
Discussion started by: elcounto
3 Replies
8. Shell Programming and Scripting
Hi All,
I am new to AWK programming. I have the following for loop in my awk program.
cat printhtml.awk:
BEGIN
-------- <some code here>
END{
----------<some code here>
for(N=0; N<H; N++)
{
for(M=5; M<D; M++) print "\t" D "";
}
-----
}
... (2 Replies)
Discussion started by: ctrld
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
input:
AAA|1
my script (the function is just an example):
gawk 'BEGIN{FS=OFS="|"}
function repeat(str, n, rep, i){
for(i=1; i<=n; i++)
rep=rep str
return rep
}
{
variable_1=repeat($1,$2)
variable_2=repeat($1,$2+1)
variable_3=repeat($1,$2+3)
... (5 Replies)
Discussion started by: beca123456
5 Replies
10. UNIX for Beginners Questions & Answers
Thanks all for taking time out and reading this thread and big Thanks to all who have come forward for rescue.
Background: I have a variable "nbrofcols" that has number of columns from a data file. Now, using this count in for loop, I am trying to get the maximum length of each column present... (7 Replies)
Discussion started by: svks1985
7 Replies
RCP(1) General Commands Manual RCP(1)
NAME
rcp - remote file copy
SYNOPSIS
rcp [-p] file1 file2
rcp [-pr] file ... directory
DESCRIPTION
Rcp copies files between machines. Each file or directory argument is either a remote file name of the form ``rhost:path'', or a local
file name (containing no `:' characters, or a `/' before any `:'s).
If the -r option is specified and any of the source files are directories, rcp copies each subtree rooted at that name; in this case the
destination must be a directory.
By default, the mode and owner of file2 are preserved if it already existed; otherwise the mode of the source file modified by the umask(2)
on the destination host is used. The -p option causes rcp to attempt to preserve (duplicate) in its copies the modification times and
modes of the source files, ignoring the umask.
If path is not a full path name, it is interpreted relative to your login directory on rhost. A path on a remote host may be quoted (using
, ", or ') so that the metacharacters are interpreted remotely.
Rcp does not prompt for passwords; your current local user name must exist on rhost and allow remote command execution via rsh(1).
Rcp handles third party copies, where neither source nor target files are on the current machine. Hostnames may also take the form
``rname@rhost'' to use rname rather than the current user name on the remote host. The destination hostname may also take the form
``rhost.rname'' to support destination machines that are running 4.2BSD versions of rcp.
SEE ALSO
cp(1), ftp(1), rsh(1), rlogin(1).
BUGS
Doesn't detect all cases where the target of a copy might be a file in cases where only a directory should be legal.
Is confused by any output generated by commands in a .profile, or .*shrc file on the remote host.
4.2 Berkeley Distribution May 12, 1986 RCP(1)