Sponsored Content
Top Forums Shell Programming and Scripting Cat command not working to display Mac file in Ubuntu Post 302930166 by diehard on Wednesday 31st of December 2014 12:36:35 AM
Old 12-31-2014
Thanks Now I got it. With your command I can put the content of file in some temp file before opening it with cat.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep/cat/more -- search in a txt file and display content from a specific "keyword"

Hi, I have a .txt file Sample: ===================== NEXT HOST ===================== AEADBAS001 ip access-list extended BLA_Incoming_Filter ip access-list extended BLA_Outgoing_Filter access-list 1 permit xxxxxxxxxxxxxx access-list 2 permit xxxxxxxxxxxxxx =====================... (4 Replies)
Discussion started by: I-1
4 Replies

2. Shell Programming and Scripting

cat in the command line doesn't match cat in the script

Hello, So I sorted my file as I was supposed to: sort -n -r -k 2 -k 1 file1 | uniq > file2 and when I wrote > cat file2 in the command line, I got what I was expecting, but in the script itself ... sort -n -r -k 2 -k 1 averages | uniq > temp cat file2 It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies

3. OS X (Apple)

Cat command not working as expected

I've been trying to figure this out since last night, and I'm just stumped. The last time I did any shell scripting was 8 years ago on a Unix box, and it was never my strong suit. I'm on a Mac running Leopard now. Here's my dilemma - hopefully someone can point me in the right direction. I'm... (10 Replies)
Discussion started by: Daniel M. Clark
10 Replies

4. UNIX for Dummies Questions & Answers

Creating File using the CAT Command

Hello , I am newbie to UNIX platform . I have read that there are two ways of creating files that is using 1.) Cat 2.) touch . With Cat Command i am unable to create a File , i is saying No file or Directory exists I logged in with root as user . please help (7 Replies)
Discussion started by: Ravi Pavanv
7 Replies

5. Shell Programming and Scripting

sed command works on Fedora/Ubuntu, but doesn't work in Mac

Hi, I have a question. I define a function using sed command: replace() { searchterm=$1 replaceterm=$2 sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp' mv $WORK'tempfile.tmp' $3 } Then I call replace 'test = 0' 'test = 1' $myfileThis code works well in... (1 Reply)
Discussion started by: Dark2Bright
1 Replies

6. Shell Programming and Scripting

sed command works on Fedora/Ubuntu, but doesn't work in Mac

Hi, I have a question. I define a function using sed command: replace() { searchterm=$1 replaceterm=$2 sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp' mv $WORK'tempfile.tmp' $3 } Then I call replace 'test = 0' 'test = 1' $myfile This code... (1 Reply)
Discussion started by: Dark2Bright
1 Replies

7. UNIX for Advanced & Expert Users

Working with configure file in ubuntu

Hi, I want to add the library in my configure file. i am doing it using autoconf in ubuntu. I am new to the autoconf. Can anyone please let me know how to add the library using configure file so that it can linked to my software which I am using? Thanks in advance!!!!! (0 Replies)
Discussion started by: diehard
0 Replies

8. UNIX for Beginners Questions & Answers

Simple sed command not working; could be a Mac/Linux vs. PC/Linux issue

Hello, I am on a Mac and trying to clean up some monthly files with a very simple SED: sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt (from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file) then output to output.txt Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies
Ns_ConnContent(3aolserver)				   AOLserver Library Procedures 				Ns_ConnContent(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnContent, Ns_ConnContentLength, Ns_ConnContentFd, Ns_ConnContentOnDisk - Routines to access request content SYNOPSIS
#include "ns.h" char * Ns_ConnContent(Ns_Conn *conn) int Ns_ConnContentLength(Ns_Conn *conn) int Ns_ConnContentFd(Ns_Conn *conn) int Ns_ConnContentOnDisk(Ns_Conn *conn) ARGUMENTS
Ns_Conn *conn (in) Pointer to given connection. _________________________________________________________________ DESCRIPTION
These procedures provide access to the request content sent with a request. char *Ns_ConnContent Returns a pointer to the content in memory. The result of Ns_ConnContent is not guarenteed to be null-terminated. Safe code should be careful to use the result of Ns_ConnContentLength to avoid overrun. int Ns_ConnContentFd Returns a file descriptor to an open temporary file which contains the content. int Ns_ConnContentLength sent beyond the content from com- Returns the length of the memory buffer and/or the size of the open temporary file. Any trailing mon browsers on a POST request is not included. int Ns_ConnContentOnDisk Returns 1 if the content is currently on disk, such that a call to Ns_ConnContentFd will not cause a new file to be created. When it returns 0, a call to Ns_ConnContent will not require a mmap() call. CONTENT PRE-READ While receiving the request before connection processing, the server will pre-read the entire content body and either copy the content to memory or spool it to an open file depending on virtual server config settings. Requests with content beyond the maxcontent virtual server setting are rejected, requests with content between maxinput and maxcontent are spooled to a temp file, and small requests (the majority of simple POST's) are copied to memory. There is no need for a request processing extension to consider possible delays in reading content from the client as all content is avail- able before connection processing begins. The rationale for this approach is that the driver thread can efficiently multiplex reading con- tent for serveral request, tolerating any network delays. Legacy direct content reading routines, for example, Ns_ConnRead, are now emu- lated on top of the Ns_ConnContent. RESOURCE MANAGEMENT
Ns_ConnContentFd returns an open file descriptor allocated by a call Ns_GetTemp and must not be closed as it is owned by the server core and will be closed at the end of the connection. In addition, there is no filename for the open file as the file is removed when opened for security reasons and to ensure garbage collection. In practice, the open file should be used to verify, parse, and copy content else- where as required. Access at the Tcl level is also available via the ns_conn contentchannel option. On a call to Ns_ConnContent, either the existing memory buffer will be returned or the temp file will be memory mapped on the first call. This will require temporary virtual memory to support the mapping until the end of the connection. Likewise, on the first call to Ns_Con- nContentFd, if a temp file does not already exists one will be allocated and the memory content will be spooled to the file. These seman- tics allow one to access the content in either mode, assuming resources are available, regardless of the original location of the content. DESIGN NOTES AND LARGE CONTENT CONSIDERATIONS
The design goal of the server is to support the ordinary case of reasonably small content requests (i.e., POST forms and small file uploads) in a convienent way without limiting a custom app to support very large requests. In particular, a call to Ns_ConnGetQuery for a multipart/file-upload POST will result in an implicit call to Ns_ConnContent to parse the fields. This could require significant temporary virtual memory plus dynamic memory to copy non-file fields into the resulting Ns_Set. See the ns_limits command to control maximum resource requirements. For custom apps, an extension could work with the underlying open file via Ns_ConnContentFd or ns_connn contentchannel to avoid large vir- tual memory requirements subject to disk space availability. To avoid inadvertant memory mapping of a large upload by other extensions calling Ns_ConnGetQuery, consider using a HTTP method other than GET or POST required by Ns_ConnGetQuery, e.g., PUT. SEE ALSO
Ns_Conn(3), Ns_ConnRead(3), ns_limits(n), ns_conn(n) KEYWORDS
connection, content AOLserver 4.0 Ns_ConnContent(3aolserver)
All times are GMT -4. The time now is 08:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy