About 19,700,000 results
Open links in new tab
  1. linux - How does "cat << EOF" work in bash? - Stack Overflow

    The cat <<EOF syntax is very useful when working with multi-line text in Bash, eg. when assigning multi-line string to a shell variable, file or a pipe. Examples of cat <<EOF syntax usage in Bash: 1. Assign multi-line string to a shell variable $ sql=$(cat <<EOF SELECT foo, bar FROM db WHERE foo='baz' EOF )

  2. how to display spaces and tabs using unix and the "cat" command

    Nov 19, 2016 · The answer to your question: No, cat command can not "show" spaces as a visible characters. It just does not contain such a feature. Cat only provides -T (show tabs) or -E (show newlines) or -A (show both types). I assume palako was meaning to say this, but instead he he jumped straight to providing you a workaround, which is valid.

  3. How to find out line-endings in a text file? - Stack Overflow

    In the bash shell, try cat -v <filename>. This should display carriage-returns for windows files. (This worked for me in rxvt via Cygwin on Windows XP). Editor's note: cat -v visualizes \r (CR) chars. as ^M. Thus, line-ending \r\n sequences will display as ^M at the end of each output line. cat -e will additionally visualize \n, namely as $.

  4. unix - How to pipe list of files returned by find command to cat to ...

    May 14, 2009 · There are a few ways to pass the list of files returned by the find command to the cat command, though technically not all use piping, and none actually pipe directly to cat. The simplest is to use backticks (`): cat `find [whatever]` This takes the output of find and effectively places it on the command line of cat.

  5. Can linux cat command be used for writing text to file?

    cat "Some text here." > myfile.txt Possible? Such that the contents of myfile.txt would now be overwritten to: Some text here. This doesn't work for me, but also doesn't throw any errors. Specifically interested in a cat-based solution (not vim/vi/emacs, etc.). All examples online show cat used in conjunction with file inputs, not raw text...

  6. cat not recognised as an internal or external command

    Oct 25, 2015 · # Convert the key from pkcs12 to pkcs1 (PEM). $ cat /path/to/xxxx-privatekey.p12 | openssl pkcs12 -nodes -nocerts -passin pass:notasecret | openssl rsa > /path/to/secret.pem on the command line but I get 'cat' is not recognized as an internal or external command, operable program or batch file. How do I resolve this?

  7. Is there replacement for cat on Windows - Stack Overflow

    Windows type command works similarly to UNIX cat. Example 1: type file1 file2 > file3 is equivalent of: cat file1 file2 > file3 Example 2: type *.vcf > all_in_one.vcf This command will merge all the vcards into one.

  8. concatenation - in R, can I stop print(cat("")) from returning NULL ...

    But cat does not return the string provided, it prints it. Subtle, but important, difference. Subtle, but important, difference. It's also good practice to glance at the documentation pages for the functions in the "See Also" section.

  9. LINUX Shell commands cat and grep - Stack Overflow

    Jun 6, 2013 · cat countryInfo.txt reads the file countryInfo.txt and streams its content to standard output. | connects the output of the left command with the input of the right command (so the right command can read what the left command prints). grep -v "^#" returns all lines that do not (-v) match the regex ^# (which means: line starts with #).

  10. Bash: redirect `cat` to file without newline - Stack Overflow

    If I cat file1 there seems to be a newline added by cat but everything I see about cat says it doesn't do that. If I vim file1 there's not a blank line at the end of the file that would indicate the newline is a part of the file, so either cat is actually adding a newline, or the redirect > is doing it, or echo adds a newline at the beginning ...

Refresh