Here is a short perl script that illustrates a convenience feature of perl -- including data with the script:
Producing:
Note that the error in your data was diagnosed, and that there are two methods of displaying the data: a quick one with print, and a more precise one with printf.
Most perl scripts are designed to read from disk files, but for small datasets, the DATA option can be useful.
Hi,
If i have an input as
c1:41 c2:0x0000.00046b3e
I want to make output display as
c1:41 c2:224062
.
Basically convert first part 0x0000 (as hex) to decimal which is 0 and
convert second part 0x00046b3e (as hex) to decimal which is 289598
and as such add both parts namely... (3 Replies)
Hello all,
I am being dumb with this and I know there is a simple solution.
I have a file with the follwing lines
bc stuff (more)...............123
bc stuffagain (moretoo)............0
bc stuffyetagain (morehere)......34
failed L3 thing..............1
failed this... (2 Replies)
Hi,
please tell me how to convert hex number to decimal
000000E7
000000000002640D
0000000000025B16
and seconds to minutes, hours, days, months, years
bytes to kbytes, mbytes , gbytes
read the following examples
while read a b
do
printf "%5d %5d\n" "0x$a" "0x$b"
done < "$FILE"... (15 Replies)
Hi All,
Sorry to say I have 0 experience writing C++ but have been asked to write a piece of code that will take a double input and an integer for number of decimal places as well as integer for padding and output a string that represents the double formatted (with comma thousand separators -... (2 Replies)
Hi,
I want to write a script that does something like this:
I have a file, in which in every line, there is a string of words, and followed by some space, a number.
Now, I want to identify the line, which has the largest startFace number (say m=8118), take that number and add it to the... (2 Replies)
Hi
I have no experience in Unix so any help would be appreciated
I have the flowing text
235543
123
45654
199
225
578
45654
199
225
I need to find this sequence from A file
45654
199
225 (22 Replies)
Hi Gurus,
I have a file that contain inventory information from someones computers:
UserName
domain\user1
DNSHostName
machine1
Caption
Microsoft Windows 7 Professional
OSArchitecture
64 bits
SerialNumber
XXX
Name
HP EliteBook Revolve 810 G1
NumberOfProcessors
1
Name
Intel(R)... (2 Replies)
I want to sort my data first by the 2nd field then by the first field.
I can't use sort -V because I don't have gnu sort and cannot install one.
How do I go about this?
Input:
G456 KT1 34
K234 KT10 45
L2 KT2 26
H5 LAF2 28
F3 LAF2 36
Output:
G456 KT1 34
L2 KT2 26
K234 KT10 45
F3... (14 Replies)
Hi,
I'd like to take a list of numbers (with a prefix) and convert to a range, for example:
cn001
cn004
cn016
cn017
cn018
cn019
cn020
cn021
cn031
cn032
cn038
cn042
cn043
cn044
cn045 (5 Replies)
Discussion started by: chrissycc
5 Replies
LEARN ABOUT OSF1
rsh
rsh(1) General Commands Manual rsh(1)NAME
rsh - Executes the specified command at the remote host or logs into a remote host
SYNOPSIS
rsh [-dn] [-l user] remote_host [command] [argument...]
The remote shell command (rsh) executes command at the remote_host, or, if no command is specified, logs into remote_host.
OPTIONS
Turns on socket debugging (using setsockopt()) on the TCP sockets used for communication with the remote host. Specifies that rsh is to
log into the remote host as user instead of the local username. If this option is not specified, the local and remote usernames are the
same. Specifies that rsh is to ignore input from STDIN. Use this option if you put rsh in the background without redirecting its input
away from the terminal. If you do not use this option in this situation, rsh blocks even if no reads are posted by the remote command.
DESCRIPTION
The rsh command sends standard input from the local host to the remote command and receives standard output and standard error from the
remote command. If you do not specify a command, rsh executes rlogin instead.
If you do not specify the -l option, the local username is used at the remote host. If -l user is entered, the specified username is used
at the remote host. In either case, the remote host allows access only if at least one of the following conditions is satisfied: The local
user ID is not superuser, and the name of the local host is listed as an equivalent host in the remote /etc/hosts.equiv file. If either
the local user ID is superuser or the check of /etc/hosts.equiv fails, the remote user's home directory must contain a $HOME/.rhosts file
that lists the local host and username.
For security reasons, any $HOME/.rhosts file must be owned by either the remote user or the root user, and should have permissions set to
600 (read and write by owner only).
In addition to the preceding conditions, rsh also allows access to the remote host if the remote user account does not have a password
defined. However, for security reasons, use of a password on all user accounts is recommended.
While the remote command is executing, pressing the Interrupt, Terminate, or Quit key sequences sends the corresponding signal to the
remote process. However, pressing the Stop key sequence stops only the local process. Normally, when the remote command terminates, the
local rsh process terminates.
To have shell metacharacters interpreted on the remote host, place the metacharacters inside (double quotes). Otherwise, the metacharac-
ters are interpreted by the local shell.
RESTRICTIONS
The rsh command is confused by output generated by commands in a file on the remote host. In particular, the messages, where are you? and
stty: Can't assign requested address can result if output is generated by the startup file.
EXAMPLES
In the following examples, the local host host1 is listed in the /etc/hosts.equiv file at the remote host host2. To check the amount of
free disk space on the remote host host2, enter: $ rsh host2 df To append a remote file to another file on the remote host, place the >>
metacharacters in (double quotes): $ rsh host2 cat test1 ">>" test2 To append a remote file at the remote host to a local file, omit the
double quotes: $ rsh host2 cat test2 >> test3 To append a remote file to a local file and use a remote user's permissions at the remote
host, use the -l option: $ rsh host2 -l jane cat test4 >> test5
FILES
Specifies remote hosts from which users can execute commands on the local host (provided these users have an account on the local host).
Specifies remote users that can use a local user account.
SEE ALSO
Commands: rcp(1), rlogin(1), rshd(8), telnet(1)
Functions: rexec(3)
Files: rhosts(4)rsh(1)