Sponsored Content
Full Discussion: global substitution in VI
Top Forums UNIX for Advanced & Expert Users global substitution in VI Post 302165867 by System Shock on Saturday 9th of February 2008 01:09:58 PM
Old 02-09-2008
If you open a file in vi and it is a continuous line, it means there are no carriage returns in your file (or at least any that vi understands), so s/$/^M/ will only put a ^M at the very end of the one big line. vi has no idea when your lines are supposed to end, how do you expect vi to recognize that?
I have no idea how you are trying to view this file, I'm guessing you are trying to view it in a windows app because you are trying to append ^M, and that is how vi "interprets" the DOS carriage return when vi opens a text file written in windows, but it doesn't mean that your windows app is going to interpret ^M as a carriage return, it is just going to see it as two characters: ^ and M.

Last edited by System Shock; 02-09-2008 at 02:20 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

How to know the global zonename from non-global zone?

It is easy to list all zones from global zones, but how to find out the global zone name from non-global zone? thx (11 Replies)
Discussion started by: honglus
11 Replies

2. Shell Programming and Scripting

sed global substitution for ' character

Hi all, I have a text file containing sql commands. I want to use sed to replace the " character with the ' character. But when i run the command below it just replaces it with a space? Do i have the escape the ' character if i want to use it? cat sql.txt update customer set custid =... (1 Reply)
Discussion started by: borderblaster
1 Replies

3. Solaris

How can we copy a directory from Global to Non-global zone?

Hi All, How can we copy a directory from global zone to non-global zone using SCP command? (8 Replies)
Discussion started by: vijaysachin
8 Replies

4. Solaris

Is there two different kernel`s running in global and non global zone?

Hi All, I want to know for non global zone there will be different kernal running? (1 Reply)
Discussion started by: vijaysachin
1 Replies

5. Solaris

How to access ENV variables of non global zones in global zone???

Hi Guys, My requirement is I have file called /opt/orahome/.profile in non global zone. PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:. export PATH PS1="\${ORACLE_SID}:`hostname`:\$PWD$ " export PS1 EDITOR=vi export EDITOR ENV=/opt/orahome/.kshrc export ENV... (1 Reply)
Discussion started by: vijaysachin
1 Replies

6. Solaris

How to see global hostname by logging in non global zones?

Hi guru Could any one help me by letting me know, how to see global hostname by logging in non global zones Regards (2 Replies)
Discussion started by: girish.batra
2 Replies

7. Solaris

How to identify a global or non-global Solaris server?

Hi, I have Solaris zone configured with Solaris 9 and 10. In Solaris 10(non global), I use the command “zonename” to get whether it is global or non-global server. For Solaris 9, what command I can use to get whether it is global or non-global server. Regards, Kalai :confused: (25 Replies)
Discussion started by: kalpeer
25 Replies

8. Shell Programming and Scripting

Why global var is not global with export

Hi, I try to define global var assuming that I can acces it from multiple sessions/terminal windows, but I can't do this with either comand line or script delcaratino/export. I'm not a root user doing this, but is this should not be matter. Even if I do this lines below in script, being in the... (3 Replies)
Discussion started by: trento17
3 Replies

9. Solaris

Global and non-global zone resource sharing - tricky

hi all, Just a simple question but i cant get the answers in the book - In my globalzone , assuming i have 4 cpus (psrinfo -pv = 0-3), if i set dedicated-cpu (ncpus=2) for my local zone Is my globalzone left with 2 cpus or still 4 cpus ? Does localzone "resource reservation.e.g. cpu in... (6 Replies)
Discussion started by: javanoob
6 Replies

10. Solaris

Date and time change in global and non global zone

Hi, If I change date and time in global zone, then it will affect in non global zones. During this process what files will get affect in non global zones and which mechanism it's using to change. gloabl zone:Solaris 11.3 X86 TIA (1 Reply)
Discussion started by: Sumanthsv
1 Replies
tofrodos(1)						      General Commands Manual						       tofrodos(1)

NAME
tofrodos - Converts text files between DOS and Unix formats. SYNOPSIS
fromdos [ options ] [file...] todos [ options ] [file...] DESCRIPTION
DOS text files traditionally have carriage return and line feed pairs as their newline characters while Unix text files have the line feed as their newline character. fromdos converts text files from the DOS format to the Unix format, while todos converts text files from the Unix format to the DOS format. The programs accept multiple filenames and wildcards as their arguments. You may also use them in a pipe. If either program finds its input redirected, it will process stdin and place the output on stdout. OPTIONS
-a Always convert. If converting from DOS to Unix, this option will cause the program to remove ALL carriage returns. The default is to remove carriage returns only if they are followed by line feeds. If converting from Unix to DOS, this option will cause the program to convert ALL linefeeds to carriage return pairs. The default is to convert linefeeds only if they are not already preceded by a carriage return. -b Make a backup of original file. The original file is renamed with the original filename and a .bak extension. For example, a file called "filename.ext" becomes "filename.ext.bak". Important: the program behaves differently if it is compiled for DOS (as compared to being compiled for Windows, Linux, Mac OS X or other systems). In view of the filename restrictions present on DOS, the DOS exe- cutable will strip the original file extension, if any, from the file before appending the .bak extension. For example, "file- name.ext" becomes "filename.bak". -d Convert from DOS to Unix. This forces the program to convert the file in a particular direction. By default, if the program is named fromdos or dos2unix, it will assume that the input file is in a DOS format and convert it to a Unix format. If the program is named todos or unix2dos, it will assume that the input file is in a Unix format and convert it to a DOS format. Using the -d option forces the program to convert from a DOS format to a Unix format regardless of how the program is named. Likewise, using the -u option forces the program to convert from a Unix format to a DOS format regardless of the name of the program. -e Abort processing on any error in any file. Normally, the program will simply skip to process the next file on the command line when it encounters any errors. This option causes it to abort on errors. -f Force: convert even if the file is not writeable (read-only). By default, if fromdos or todos finds that the file does not have write permission, it will not process that file. This option forces the conversion even if the file is read-only. -h Display a short help screen on the program usage and quit. -l<logfile> Log error messages to <logfile>. Note that if your command line has an error, such as when you specify an unknown option, the error message for the command line option error will be issued to stderr instead and not logged. -o Overwrite the original file (no backup). This is the default. -p Preserve file ownership and time. On systems like Linux, the file ownership will only be preserved if the user is root, otherwise it will just set the file time and silently fail the change of file ownership. If you want a warning message when the file ownership cannot be changed, use -v. -u Convert from Unix to DOS. See the -d option above for more information. -v Verbose. -V Show version message and quit. AUTHOR
The program and its documentation are copyrighted (c) 1996-2008 by Christopher Heng. All rights reserved. They are distributed under the terms of the GNU General Public License Version 2. The latest version of tofrodos can be obtained from http://www.thefreecountry.com/tofrodos/index.shtml 2011 Version 1.7.9 tofrodos(1)
All times are GMT -4. The time now is 05:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy