Yes, Windows uses CR-LF (Carriage Return - Linefeed) to terminate a line and Unix uses LF. So in order to process a windows file on Unix in most cases the CR should be removed before processing. If the result needs to be used on a Windows platform the CR needs to be added again before every LF.
To remove the CR:
To add the CR:
For an all in one command, resulting in a CR-LF version, try:
or better:
or without converting first:
Last edited by Scrutinizer; 11-30-2013 at 11:27 AM..
hello,
I am trying to append\insert the text that exists in file A into file B.
for instance:
File A contains: abcdef
File B contains: ghijklm
can i insert into file A the content in file B without damaging\deleting the input into file A?
is there a command in shell that enables such... (1 Reply)
hi all,
can anybody help me with script or command to ftp some text file from windows machine to AIX machine.
this is shud be done by executing a shell script. (1 Reply)
Hi,
Want to append the text to a new file,
echo "set `sqlplus -S abc/xyz123@localdb<<EOS" >> chk_test_append.sh
echo "EOS`" >> chk_test_append.shbut getting the below error :
what wrong is written ?
With Regards (4 Replies)
actually, i have to grep the value of cpu usage from six differrent servers and it has to generated in a single report( in a single text or excel file). i have used the below command for grepping the value.
top -n 1 > arun.txt
cat arun.txt | grep 'init' | cut -c 49-53 > output1.csv
like... (2 Replies)
Hi,
i am using unix server and bash shell..
i have two csv files...
i have file 1 as below...
arun
bvb
ssx
ccc
and file 2 as below
manas
friu
dfgg
cat (3 Replies)
Hey all
I am trying to append a file called datebook.txt. I want to append the end of each line containing the name Fred with three ***. I believe I need to make the * loose its meta character meaning in addition to using the append command. I have tried several variations of this command and I... (3 Replies)
I am trying to count number of record in a file and then append a trailer to that file.
Trailer should e in the format as below
T| <count of records>
count of records ---> this count should be one less than the actual count obtained, as the file will have a header.
I have drafted a... (3 Replies)
Hello,
I want some directions for a command inside a shell script which would copy files from some path on my windows os (say my documents) to the path where my shell script is saved and I want it to exit the sftp session and continue executing the remaining lines in my shell script after... (2 Replies)
ssh -q "server_name sudo echo 'dbagroup::1234' >> sudo /etc/group"if i execute the above code its not getting appended.
my requirement is to login to remote server and append dbagroup::1234 in /etc/group i am able to achieve this with tee -a command
want to know why its not working with >>... (5 Replies)
Discussion started by: chidori
5 Replies
LEARN ABOUT OSX
cat
CAT(1) BSD General Commands Manual CAT(1)NAME
cat -- concatenate and print files
SYNOPSIS
cat [-benstuv] [file ...]
DESCRIPTION
The cat utility reads files sequentially, writing them to the standard output. The file operands are processed in command-line order. If
file is a single dash ('-') or absent, cat reads from the standard input. If file is a UNIX domain socket, cat connects to it and then reads
it until EOF. This complements the UNIX domain binding capability available in inetd(8).
The options are as follows:
-b Number the non-blank output lines, starting at 1.
-e Display non-printing characters (see the -v option), and display a dollar sign ('$') at the end of each line.
-n Number the output lines, starting at 1.
-s Squeeze multiple adjacent empty lines, causing the output to be single spaced.
-t Display non-printing characters (see the -v option), and display tab characters as '^I'.
-u Disable output buffering.
-v Display non-printing characters so they are visible. Control characters print as '^X' for control-X; the delete character (octal
0177) prints as '^?'. Non-ASCII characters (with the high bit set) are printed as 'M-' (for meta) followed by the character for the
low 7 bits.
EXIT STATUS
The cat utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
The command:
cat file1
will print the contents of file1 to the standard output.
The command:
cat file1 file2 > file3
will sequentially print the contents of file1 and file2 to the file file3, truncating file3 if it already exists. See the manual page for
your shell (i.e., sh(1)) for more information on redirection.
The command:
cat file1 - file2 - file3
will print the contents of file1, print data it receives from the standard input until it receives an EOF ('^D') character, print the con-
tents of file2, read and output contents of the standard input again, then finally output the contents of file3. Note that if the standard
input referred to a file, the second dash on the command-line would have no effect, since the entire contents of the file would have already
been read and printed by cat when it encountered the first '-' operand.
SEE ALSO head(1), more(1), pr(1), sh(1), tail(1), vis(1), zcat(1), setbuf(3)
Rob Pike, "UNIX Style, or cat -v Considered Harmful", USENIX Summer Conference Proceedings, 1983.
STANDARDS
The cat utility is compliant with the IEEE Std 1003.2-1992 (``POSIX.2'') specification.
The flags [-benstv] are extensions to the specification.
HISTORY
A cat utility appeared in Version 1 AT&T UNIX. Dennis Ritchie designed and wrote the first man page. It appears to have been cat(1).
BUGS
Because of the shell language mechanism used to perform output redirection, the command ``cat file1 file2 > file1'' will cause the original
data in file1 to be destroyed!
The cat utility does not recognize multibyte characters when the -t or -v option is in effect.
BSD March 21, 2004 BSD