Sponsored Content
Top Forums UNIX for Dummies Questions & Answers cat: write error: Connection reset by peer Post 302509150 by acmvillareal on Wednesday 30th of March 2011 04:55:56 AM
Old 03-30-2011
grep <string> $TMPFILE

cat $TMPFILE | sed '/<string>/!d'

cat $TMPFILE | sed -n '#p' ---> # refers to the line number
 

10 More Discussions You Might Find Interesting

1. IP Networking

connection reset by peer

:confused: HI, We have 2 servers ( win 2003 + sun 5.8 ) and we run a rsh from the NT to the UNIX. The program runs a shell script on the UNIX and waits for the answer in the EOF. How ever, after period of appx 2 min there is a reply "Recv failed:Connection reset by peer". while the... (5 Replies)
Discussion started by: eyalush
5 Replies

2. HP-UX

XIO: fatal IO error 232 (Connection reset by peer) on X server "192.168.1.239:0.0"

Hi All... I'm newbie here..., i have problem when installing oracle9206, i use HPUX 11.11, i'm using Xmanager enterprise 2.1 for forwarding from server A to my laptop # export DISPLAY=192.168.1.239:0.0 # echo $DISPLAY output ==> 192.168.1.239:0.0 at the oracle directory, i execute ... (3 Replies)
Discussion started by: grimanda
3 Replies

3. Shell Programming and Scripting

ssh - connection reset by peer

I use ssh to work on the server (OS X 10.4.x) remotely from home (Debian / OS X 10.5.3). If I leave my machine idle, I get disconnected after a couple of minutes. I get the following error message: Read from remote host "server name": Connection reset by peer Connection to "server name" closed.... (2 Replies)
Discussion started by: osxhawk
2 Replies

4. Shell Programming and Scripting

Connection reset by peer

hi i am connecting to a remote server using sftp protocol. i am using the command like "sftp USER01@122.10.12.45" then i got the error "Couldn't read packet: Connection reset by peer" please help its very urgent (5 Replies)
Discussion started by: Satyak
5 Replies

5. IP Networking

connection reset by peer on freebsd

hi all. am running postgresql in a vm on debian server. i have some client programs connecting to the db. when i check the logs of postgresql i see "connection reset by peer" can someone help me with this issue... thanks. (1 Reply)
Discussion started by: coolatt
1 Replies

6. UNIX for Advanced & Expert Users

Connection reset by peer..closing connection

Hello I'm facing the above problem while doing a performance run. I've a script which I'm launching from my windows desktop using mozilla. The script will invoke backend action on a Solaris host which in turn feeds the records to a driver located on a linux box(Cent OS). What's happening is... (1 Reply)
Discussion started by: subramanyab
1 Replies

7. UNIX for Dummies Questions & Answers

fatal: Read from socket failed: Connection reset by peer

I get this error when I log in through console: "fatal: Read from socket failed: Connection reset by peer". Can you tell me what this is and why it happens, and how to stop it? Thank you. (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

8. UNIX for Dummies Questions & Answers

Grep: writing output: Connection reset by peer

Hi , when i run , tkt=/u01/ctrlfile/tkt.tmp grep "TICKET NBR" $cdrFile | head -$count | tail -1 > $tkt i got error grep: writing output: Connection reset by peer but some time its working withour error its working fine but some time i got this error any help please (5 Replies)
Discussion started by: OTNA
5 Replies

9. UNIX for Dummies Questions & Answers

Sftp - Couldn't read packet: Connection reset by peer

Hello to all, i have a problem when trying to estabilish a sftp connection. i setup a sftp server (i used feeFTPd) and i'm now trying to connect from two different machines. from the first one everything is fine: $ sftp -vvv user@xxx.xxx.xxx.xxx Connecting to xxx.xxx.xxx.xxx...... (9 Replies)
Discussion started by: dc26
9 Replies

10. Red Hat

Can't SSH - Connection reset by Peer

Hi Guys, I can't SSH to a remote system - connection reset by peer..any ideas ? -The Source is Linux, the Remote is Windows -The remote has OpenSSH running on Port 22 - Telnet confirms port is open -User1 has a RSA2 Key (2048) key, which is capture in the 1010101-pub.key specified by the... (1 Reply)
Discussion started by: stevie_velvet
1 Replies
mktemp(1)							   User Commands							 mktemp(1)

NAME
mktemp - make temporary filename SYNOPSIS
mktemp [-dtqu] [-p directory] [template] DESCRIPTION
The mktemp utility makes a temporary filename. To do this, mktemp takes the specified filename template and overwrites a portion of it to create a unique filename. See OPERANDS. The template is passed to mkdtemp(3C) for directories or mkstemp(3C) for ordinary files. If mktemp can successfully generate a unique filename, the file (or directory) is created with file permissions such that it is only read- able and writable by its owner (unless the -u flag is given) and the filename is printed to standard output. mktemp allows shell scripts to safely use temporary files. Traditionally, many shell scripts take the name of the program with the PID as a suffix and used that as a temporary filename. This kind of naming scheme is predictable and the race condition it creates is easy for an attacker to win. A safer, though still inferior approach is to make a temporary directory using the same naming scheme. While this guaran- tees that a temporary file is not subverted, it still allows a simple denial of service attack. Use mktemp instead. OPTIONS
The following options are supported: -d Make a directory instead of a file. -p directory Use the specified directory as a prefix when generating the temporary filename. The directory is overridden by the user's TMPDIR environment variable if it is set. This option implies the -t flag. -q Fail silently if an error occurs. This is useful if a script does not want error output to go to standard error. -t Generate a path rooted in a temporary directory. This directory is chosen as follows: If the user's TMPDIR environment variable is set, the directory contained therein is used. Otherwise, if the -p flag was given the specified directory is used. If none of the above apply, /tmp is used. In this mode, the template (if specified) should be a directory component (as opposed to a full path) and thus should not contain any forward slashes. -u Operate in unsafe mode. The temp file is unlinked before mktemp exits. This is slightly better than mktemp(3C), but still introduces a race condition. Use of this option is discouraged. OPERANDS
The following operands are supported: template template can be any filename with one or more Xs appended to it, for example /tmp/tfile.XXXXXX. If template is not specified, a default of tmp.XXXXXX is used and the -t flag is implied. EXAMPLES
Example 1 Using mktemp The following example illustrates a simple use of mktemp in a sh(1) script. In this example, the script quits if it cannot get a safe tem- porary file. TMPFILE=`mktemp /tmp/example.XXXXXX` if [ -z "$TMPFILE" ]; then exit 1; fi echo "program output" >> $TMPFILE Example 2 Using mktemp to Support TMPDIR The following example uses mktemp to support for a user's TMPDIR environment variable: TMPFILE=`mktemp -t example.XXXXXX` if [ -z "$TMPFILE" ]; then exit 1; fi echo "program output" >> $TMPFILE Example 3 Using mktemp Without Specifying the Name of the Temporary File The following example uses mktemp without specifying the name of the temporary file. In this case the -t flag is implied. TMPFILE=`mktemp` if [ -z "$TMPFILE" ]; then exit 1; fi echo "program output" >> $TMPFILE Example 4 Using mktemp with a Default Temporary Directory Other than /tmp The following example creates the temporary file in /extra/tmp unless the user's TMPDIR environment variable specifies otherwise: TMPFILE=`mktemp -p /extra/tmp example.XXXXX` if [ -z "$TMPFILE" ]; then exit 1; fi echo "program output" >> $TMPFILE Example 5 Using mktemp to Remove a File The following example attempts to create two temporary files. If creation of the second temporary file fails, mktemp removes the first file before exiting: TMP1=`mktemp -t example.1.XXXXXX` if [ -z "$TMP1" ]; then exit 1; fi TMP2=`mktemp -t example.2.XXXXXX` if [ -z "$TMP2" ]; then rm -f $TMP1 exit 1 fi Example 6 Using mktemp The following example does not exit if mktemp is unable to create the file. That part of the script has been protected. TMPFILE=`mktemp -q -t example.XXXXXX` if [ ! -z "$TMPFILE" ] then # Safe to use $TMPFILE in this block echo data > $TMPFILE ... rm -f $TMPFILE fi ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of mktemp with the -t option: TMPDIR. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), mkdtemp(3C), mkstemp(3C), attributes(5), environ(5) NOTES
The mktemp utility appeared in OpenBSD 2.1. The Solaris implementation uses only as many `Xs' as are significant for mktemp(3C) and mkstemp(3C). SunOS 5.11 10 Jan 2008 mktemp(1)
All times are GMT -4. The time now is 08:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy