07-11-2001
Quote:
Originally posted by witt
Imagines that the contents of the archive /tmp/trash.txt is :
See jill run
jill runs up hill
see jill fall
see jack run
jack runs up hill
see jack fall
execute :
cat /tmp/trash.txt | awk '$3 == "run" { print $0 }'
This assumes you know the value in the last column of the lines you want to print. Not necessarily always the case. A better solution would be:
perl -ne 'print if ($. % 3 == 0)' <I>inputfile</I>
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
where can i find an zip utility similar than windows zip for HP-UX?
Jesus (1 Reply)
Discussion started by: jgutierrez29
1 Replies
2. Programming
I wrote a makefile, every thing is working fine,
But One of the C header files which is created by me is kept in a different folder other than the current directory,
I have given this PATH to VPATH Variable
Example :- VPATH = /home/user1/projects/victor.h
It gives an error as : file... (4 Replies)
Discussion started by: victorvvk
4 Replies
3. Solaris
Hi Guys,
I m very confused about the make/makefile utility in all unix.
1) My questions is why we need make.
2) Why some source code needs to complile.
3) I download the Bind 9 from Sunfreeware.com. I use pkgadd -d to install the bind. I 'm struck here becasue I can't find /etc/named.conf... (2 Replies)
Discussion started by: bigmoon
2 Replies
4. HP-UX
Hi
Does anybody know is there is any troubleshooting for kcalarm?
How can i see what parameter exceded it's range while running command fr monitoring "any parameter"?
Thanks :o (0 Replies)
Discussion started by: m_mouse
0 Replies
5. UNIX for Dummies Questions & Answers
Hi experts.
We have a HP-Unix server, we deleted some files and folders from the server. Is there any utilities that we can use to ensure those deleted files and folders are not recoverable? We used rm command to delete these files.
Cheers,
RT:confused: (1 Reply)
Discussion started by: robtseng
1 Replies
6. AIX
We have processes that run on our AIX box that sometimes run away and end up consuming 99% of the CPU. I'd like to create a script that would attempt to monitor when this happens and send an email alert with the PID and CPU %. Has anyone done such a thing? I know that you can run the nmon output to... (6 Replies)
Discussion started by: ssmith001
6 Replies
7. Shell Programming and Scripting
hi experts,
Can you please help me out in removing delimiters with in double quotes from a CSV file.
input:
=====
a,"bnn,",dgd, "sagfh,dj",ad
output
=====
a,"bnn",dgd, "sagfhdj",ad
there are so mnay fileds in a row and there are millions of rows.
Thanks in an advance.... (6 Replies)
Discussion started by: subhendu81
6 Replies
8. Programming
Hi,
Could someone tell me why make utility is mostly preferred for compilation and generating executable in UNIX rather than any user created scripts which contains commands for compilation? (2 Replies)
Discussion started by: naan
2 Replies
9. Shell Programming and Scripting
Hi,
I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server.
How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies
10. Shell Programming and Scripting
Hi,
I am new to shell scripting, started learning script before one month. I can't understand the below script.
dialog --title "Inputbox - To take input from you" --backtitle "Linux Shell\
Script Tutorial" --inputbox "Enter your name please" 8 60 2>/tmp/input.$$
In this script they are... (1 Reply)
Discussion started by: raj1983
1 Replies
RSH(1) BSD General Commands Manual RSH(1)
NAME
rsh -- remote shell
SYNOPSIS
rsh [-46dn] [-l username] [-t timeout] host [command]
DESCRIPTION
The rsh utility executes command on host.
The rsh utility copies its standard input to the remote command, the standard output of the remote command to its standard output, and the
standard error of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rsh
normally terminates when the remote command does. The options are as follows:
-4 Use IPv4 addresses only.
-6 Use IPv6 addresses only.
-d Turn on socket debugging (using setsockopt(2)) on the TCP sockets used for communication with the remote host.
-l username
Allow the remote username to be specified. By default, the remote username is the same as the local username. Authorization is deter-
mined as in rlogin(1).
-n Redirect input from the special device /dev/null (see the BUGS section of this manual page).
-t timeout
Allow a timeout to be specified (in seconds). If no data is sent or received in this time, rsh will exit.
If no command is specified, you will be logged in on the remote host using rlogin(1).
Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote
machine. For example, the command
rsh otherhost cat remotefile >> localfile
appends the remote file remotefile to the local file localfile, while
rsh otherhost cat remotefile ">>" other_remotefile
appends remotefile to other_remotefile.
FILES
/etc/hosts
/etc/auth.conf
SEE ALSO
rlogin(1), setsockopt(2), rcmd(3), ruserok(3), auth.conf(5), hosts(5), hosts.equiv(5), rlogind(8), rshd(8)
HISTORY
The rsh command appeared in 4.2BSD.
BUGS
If you are using csh(1) and put a rsh in the background without redirecting its input away from the terminal, it will block even if no reads
are posted by the remote command. If no input is desired you should redirect the input of rsh to /dev/null using the -n option.
You cannot run an interactive command (like ee(1) or vi(1)) using rsh; use rlogin(1) instead.
Stop signals stop the local rsh process only; this is arguably wrong, but currently hard to fix for reasons too complicated to explain here.
BSD
October 16, 2002 BSD