Sponsored Content
Full Discussion: No eol in swap file
Operating Systems OS X (Apple) No eol in swap file Post 302858249 by gale on Sunday 29th of September 2013 08:14:06 PM
Old 09-29-2013
No eol in swap file

I was editing a file with vi and crashed so when I opened the file again I had the .swp file to deal with. I made the wrong choice trying to recover my file and wound up with a file with no eol (end of line) characters.

I have forgotten the code to substitute and don't want to make an even bigger mess. What I see now are thousands of ^@ characters.

After I thought I had recovered the file I gave the command
mv .[filename].swp [filename]
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Swap file

I just started working with AIX and need a little help. Is there a command to find the size of the swap file. (1 Reply)
Discussion started by: paule
1 Replies

2. Shell Programming and Scripting

Finding EOL char is there or not in a big size file

Hi, I am using ksh. I have to find wether data file has EOL or not. as per my knowledge we can easily find by checking each character. But this is a tedious job as per my requirement because my data file size is very big . It may be in 25-30 MB. So please advice me how i can check wether... (4 Replies)
Discussion started by: HariRaju
4 Replies

3. Shell Programming and Scripting

how to know whether that file has eol or noeol before opening that file in VI editor

Hi, I want to check whether file has EOL or NOEOL before opening this file in VI editor. My file is very big its in terms of 15-20 MB. I am using ksh for this. When we opened the file in vi editor, normally at last line we are able to see whether this is eol or noeol file. But i does want... (1 Reply)
Discussion started by: HariRaju
1 Replies

4. Solaris

Swap config - Mirror swap or not?

Hello and thanks in advance. I have a Sun box with raid 1 on the O/S disks using solaris svm. I want to unmirror my swap partition, and add the slice on the second disk as an additional swap device. This would give me twice as much swap space. I have been warned not to do this by some... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

5. Shell Programming and Scripting

Lookup value in file and Append new value at EOL

Hi All, I am new to shell scripting but have successfully created some of my own scripts using awk and sed. However, I have come across a problem that I cannot solve on my own and have not been able to find a good example that relates to what I am trying to do. What I need is for the... (4 Replies)
Discussion started by: kixazz2529
4 Replies

6. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

7. Linux

How to insert EOL?

How can I insert End of line (EOL) in Unix to file. Thanks (5 Replies)
Discussion started by: mrn6430
5 Replies

8. AIX

How to remove ^M from the EOL?

The only way I know of is manually as follows: To remove for example ^M from a file: - vi the file name that has ^M at the end of each line. - Hit <Esc> - Type :g/ - Hold the CNTRL key and press V and M then release the CNTRL key At the buttom you should see this by now: ... (3 Replies)
Discussion started by: mrn6430
3 Replies

9. Solaris

Explain the output of swap -s and swap -l

Hi Solaris Folks :), I need to calculate the swap usage on solaris server, please let me understand the output of below swap -s and swap -l commands. $swap -s total: 1774912k bytes allocated + 240616k reserved = 2015528k used, 14542512k available $swap -l swapfile dev swaplo... (6 Replies)
Discussion started by: seenuvasan1985
6 Replies
rpmatch(3)						     Library Functions Manual							rpmatch(3)

NAME
rpmatch - Determines whether a response is affirmative or negative LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <stdlib.h> int rpmatch( const char *response); PARAMETERS
User input entered in response to a question that requires an affirmative or negative answer. DESCRIPTION
The rpmatch() function determines whether the string value of the response parameter matches the affirmative or negative response expres- sion as specified by the LC_MESSAGES category in the program's current locale. Both response expressions, defined in the locale, may be extended regular expressions. A possible value of the affirmative expression, yesexpr, for a English-language locale is "^([yY]|[yY][eE][sS])". This expression will match any value of the response parameter that has consists of the letter Y (in uppercase or lowercase) or the letters YES (in any mixture of uppercase and lowercase letters). EXAMPLES
The following example requests a response from the user and uses the rpmatch() function to determine if the response is affirmative or neg- ative. #include <stdlib.h> #include <stdio.h> #include <locale.h> #include <string.h> #define SLENGTH 80 main() { char str[SLENGTH], *eol; int ans; (void)setlocale(LC_ALL, ""); printf("Do you want to perform this operation: "); fgets(str, SLENGTH, stdin); if ((eol = strchr(str, ' ')) != NULL) *eol = ''; /* Replace newline with null */ else return; /* Line entered too long */ ans = rpmatch(str); if (ans == 1) printf("You responded affirmatively "); else if (ans == 0) printf("You responded negatively "); else printf("Your answer did not match "); } RETURN VALUES
A value of 1 is returned if the string value of the response parameter is matched by the affirmative expression; a value of 0 (zero) is returned if the string value of the response parameter is matched by the negative expression. If neither expression matches the string value of the response parameter, a value of -1 is returned. RELATED INFORMATION
Commands: grep(1). Functions: regcomp(3), regexec(3), setlocale(3). Files: locale(4). delim off rpmatch(3)
All times are GMT -4. The time now is 09:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy