|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Exactly what does the command mqsiaddbrokerinstance do? |
« View previous topic :: View next topic » |
Author |
Message
|
zpat |
Posted: Fri May 03, 2013 9:49 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
There is a 4th character in it, because when I created the HAworkpath file in this (vi) way, it didn't work because WMB tried to use a path name with this spurious character.
Maybe it's a control Z or something, anyway vi sucks as always. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 03, 2013 10:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
zpat wrote: |
vi sucks as always. |
vi is cool.
I've also just performed the following keystrokes on AIX & Solaris:
Code: |
vi test.txt<CR>i123<esc>:wq |
I've got what appears to be a 3 byte file
What code page are you using and is there anything odd in your .profile or any of the inherited ones (if used)? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri May 03, 2013 11:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
zpat wrote: |
Any know how to make VI (a VIle editor) edit a file without adding a line feed (or CR) to it? |
No, vile is just a clone of vi ...
The standard vi editor for Unix platforms is a line-oriented text editor, not a binary editor. It expects a LF character ([ctrl-j]) to terminate every line, including the last line. It issues a warning when reading a file with a missing LF (something like "Incomplete last line"), and adds the missing LF when writing the file. There is no way to suppress this behavior. vi does not add spurious CR ([ctrl-m]) characters.
There are other (non-editor) commands available for creating files without the trailing LF, such as any one of the following:
Code: |
print -n '123' > file
echo '123\c' > file
cat > file # followed by keyboard input "1 2 3 [ctrl-d] [ctrl-d]"
tr -d '\n' < file1 > file2 |
(Although the tr command above would remove all of the LF characters when copying from file1 to file2, not just the last LF character.)
zpat wrote: |
There is a 4th character in it ... |
The od command is sometimes useful for displaying the bytes in a file, (for example, "od -c file"):
Code: |
0000000 1 2 3 \n
0000004 |
The first column indicates the byte offset (in octal). In this example, there are four characters; the last character ('\n') is a LF character.
zpat wrote: |
anyway vi sucks as always |
It does take some getting used to, to fully appreciate it. But end-of-line handling issues is a common problem for many standard text editors, and certainly not unique to vi. Many users resort to installing third-party editors that provide more flexible end-of-line handling; some vi clones offer a "binary mode" option, to suppress the adding of the trailing LF. |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat May 04, 2013 7:29 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
rekarm01 wrote: |
The standard vi editor for Unix platforms is a line-oriented text editor, not a binary editor. It expects a LF character ([ctrl-j]) to terminate every line, including the last line. It issues a warning when reading a file with a missing LF (something like "Incomplete last line"), and adds the missing LF when writing the file. There is no way to suppress this behavior. vi does not add spurious CR ([ctrl-m]) characters.
|
This is news to me and I've been using Unix in one form or another since 1981.
AFAIK, 'vi' does not put a line termination character (LF or CR/LR etc) into the code unless you tell it.
If I don't want anything on the last line of a file then I don't hit return. I get just the characters I types (as explained by Vitor).
If you want a line orientated editor for Unix then 'ed[lin]' is what you want.
in some unix shells such as bash, you have command like
'printf' which is very familiar to 'C' programmers. With this command you have to be specific about what line termination characters you use and where. you get total control
Funnily enough, I've just used that (on solaris) and edited the output file with 'vi' and vi didn't add anything to the file at all.
If you want a decent binary editor, I'd look no further than Teco but only us old fogies will remember that one. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
rekarm01 |
Posted: Sun May 05, 2013 6:23 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
smdavies99 wrote: |
This is news to me ... |
Really? It's easy enough to confirm one way or another, by examining the resulting output file for a trailing newline, with od or similar utility.
smdavies99 wrote: |
AFAIK, 'vi' does not put a line termination character (LF or CR/LR etc) into the code unless you tell it. |
Don't confuse the LF character with the CR character. For Unix platforms, LF is the newline character, and CR is just another control character. For vi implementations that conform to the Single Unix Specification, "a trailing newline character will be added to the last line of the file if one was not present in the input".
smdavies99 wrote: |
If you want a decent binary editor, I'd look no further than Teco but only us old fogies will remember that one. |
TECO, which begat Emacs? |
|
Back to top |
|
 |
hallmark |
Posted: Mon Jun 03, 2013 7:03 am Post subject: |
|
|
 Voyager
Joined: 10 Mar 2005 Posts: 76
|
vi aside (and I replicated zpat's issue with the line feed) you could opt for simply copying the file from the primary node to the standby node (binary copy) which should be an exact replica.
Rob _________________ Rob |
|
Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|