The script below should do what I think you are asking. You will need to update the variables for:
servers = a space-delimited list of the server names with login IDs
fileName = the full name with path of the file to be edited (assumes the same file on each server
newvalue = the new number to be inserted (assumes the same value for each server)
After executing this script, you will find a new file in each location with the same file name with a suffix of the current date (i.e. _20100325).
If you need different values for each server, then this will need some tweaking.
Write a sed script to extract the year, rank, and stock for the most recent 10 years available in the file top10_mktval.csv, and output in the following format:
------------------------------
YEAR |RANK| STOCK
------------------------------
2007 | 1 | Exxon... (1 Reply)
Hello and thx for reading this
I'm using sed to remove only the leading spaces in a file
bash-280R# cat foofile
some text
some text
some text
some text
some text
bash-280R#
bash-280R# sed 's/^ *//' foofile > foofile.use
bash-280R# cat foofile.use
some text
some text
some text... (6 Replies)
i made a script to update a lot of xml files. to save me some time. Ran it and it replaced all the the files with a 0kb file. The problem i was having is that I am using sed to change xml node <doc_root>. The problem with this is it has a / in the closing xml tag and the stuff inside will also have... (4 Replies)
Hi all,
First off, Thank you all for the knowledge I have gleaned from this site!
Deleting Records from a text file... sed paragraphs
The following code works nearly perfect, however each time it is run on the log file it adds a newline at the head of the file, run it 5 times, it'll have 5... (1 Reply)
I'm not sure if the problem I'm seeing is an artifact of sed or simply a beginner's mistake. Here's the problem: I want to add a zero-width space following each underscore between XML tags. For example, if I had the following xml:
<MY_BIG_TAG>This_is_a_test</MY_BIG_TAG>
It should look like... (8 Replies)
My need is :
Want to change
docBase="/something/something/something"
to
docBase="/only/this/path/for/all/files"
I have some (about 250 files)xml files.
In FileOne it contains
<Context path="/PPP" displayName="PPP" docBase="/home/me/documents" reloadable="true" crossContext="true">... (1 Reply)
Hi,
I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :-
./sample.sh: line... (12 Replies)
I am learning SED and just following the shell scripting book, i have trouble understanding the grep and sed statement,
Question : 1
__________
/opt/oracle/work/antony>cat teledir.txt
jai sharma 25853670
chanchal singhvi 9831545629
anil aggarwal 9830263298
shyam saksena 23217847
lalit... (7 Replies)
Discussion started by: Antony Ankrose
7 Replies
LEARN ABOUT OSX
rexec
REXEC(1) General Commands Manual REXEC(1)NAME
rexec -- remote execution client for an exec server
SYNOPSIS
rexec [ -abcdhns -l username -p password ] host command
DESCRIPTION
Rexec calls the rexec(3) routine to act as a client for the remote host's rexecd(8) server.
It asks that ``command'' be run on the host computer, using username/password authentication. See rexec(3) and rexecd(8) for details of the
protocol.
OPTIONS
Rexec accepts several options, but only three are likely to be very useful:
-l username
Set the log-in name on the remote host to username.
-p password
Provide the password for the remote account. The command line argument will be blanked after being parsed, to prevent it from being
seen with ps(1). However, it is still not very secure to type the password on the command line. In particular, be sure that the
shell's history file is protected.
-n Explicitly prompt for name and password, even if provided in the environment, in the $HOME/.netrc file, or in the environmental
variables REXEC_USER and REXEC_PASS.
Other options that might be useful with non-standard remote exec daemons, or to debug connections:
-a Do not set up an auxiliary channel for standard error from command; the remote standard error and output are then both returned on
the local standard output. By default, rexec asks that a separate channel be set up for diagnostic output from the remote command.
-b Use signal handling as in BSD rsh(1). Only the signals SIGINT, SIGQUIT, and SIGTERM are echoed to the remote process. They do not
remain raised locally, so rexec waits for the remote command to shutdown its side of the socket. Also, CNTRL-Z will only suspend
execution locally--the remote command may continue to run.
-c Do not close remote standard input when local standard input closes. Normally the standard input to the remote command is closed
when the local standard input is closed.
-d Turn on debugging information. In particular the command sent to the remote host will be echoed.
-h Print a usage message.
-s Do not echo signals received by the rexec onto the remote process. Normally, signals which can be trapped are passed on to the
remote process; then, when you type CNTRL-C, the remote process terminates as well.
USERNAME AND PASSWORD Rexec(1) searches for the username and password in the following order:
1. If -n is given on the command line, the user will always be prompted for both, even if they are also given on the command line.
2. The command line will be parsed
3. If the environmental variables REXEC_USER or REXEC_PASS are defined, they will define the username or password.
4. The $HOME/.netrc file will be searched. See ftp(1) for a description of this file's format.
5. Finally, the user will be prompted if either the username or password remains undefined.
SECURITY
Users of this command should be aware that rexec(3) transmits their password to the remote host clear text, not encrypted. If the network
is not secure to the remote host, the password can be comprimised.
SIGNALS
Without the -b option, all signals which can be handled are echoed to the remote process. Afterwards, however, they remain raised in the
local process. Typically, this means that rexec(1) will exit after receiving a fatal signal, even if the remote process has arranged to
handle or ignore it.
Differing operating systems use differing signal numbers; for example AIX and SunOS use 18 for SIGTSTP (^Z), while Linux uses 20. There-
fore, it may have a different effect remotely than locally. In particular, typing CNTL-Z may not suspend the execution of the remote
process.
EXAMPLE
rexec othermachine cat ">remote_file; date" <local_file
will send local_file to the othermachine as remote_file.
BUGS
Please send bug reports, system incompatibilities, and job offers to the author.
SEE ALSO rexec(3), rexecd(8), rsh(1)AUTHOR
Michael Sadd
mas22@cornell.edu
http://www.tc.cornell.edu/~sadd/
Thanks to Orange Gopher (2/10/97) and Johannes Plass (plass@dipmza.physik.uni-mainz.de, Oct. 17 1996) for useful suggestions.
February 14, 1997 REXEC(1)