09-12-2013
Use tusc to show the open system calls, that gives the filename for each one opened.
This User Gave Thanks to jim mcnamara For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.
Example:
File.txt
AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc
---------
test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies
2. Shell Programming and Scripting
Hi All,
I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file.
Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies
3. Shell Programming and Scripting
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies
4. Shell Programming and Scripting
Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions.
... (4 Replies)
Discussion started by: aix_admin_007
4 Replies
5. Shell Programming and Scripting
Hi All,
I have result log file which looks like this (below): from the content need to consolidate the result and put it in tabular form
1). Intercomponents Checking
Passed: All Server are passed.
======================================================================
2). OS version Checking... (9 Replies)
Discussion started by: Optimus81
9 Replies
6. Red Hat
I ran the following command.
cat abc.c > abc.c
I got message the following message from command cat:
cat: abc.c : input file is same as the output file
How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies
7. Shell Programming and Scripting
currently I have process from a raw file to this stage
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_VOID" ADD CONSTRAINT "PK_TC_TXN_VOID" PRIMARY KEY ("TC_TXN_IID")
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_AMT" ADD CONSTRAINT "PK_TC_TXN_AMT" PRIMARY KEY ("TC_TXN_AMT_IID")
ALTER TABLE... (10 Replies)
Discussion started by: jediwannabe
10 Replies
8. Shell Programming and Scripting
Hi Guys,
I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts.
I used below but it is not working:
OFILE=/home/home1/report1
echo "report1 details" > $OFILE
=/home/home1/1.sh > $OFILE
echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies
9. Shell Programming and Scripting
I have a file
# cat /root/llll
11
22
33
44
When I cat this file content to a variable inside a shell script and echo that shell script, it does not show up as separate lines. I need echo output similar to cat.
cat /root/shell_script.sh
#!/bin/bash
var=`cat /root/llll`
echo $var (2 Replies)
Discussion started by: anil510
2 Replies
10. Shell Programming and Scripting
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
fopen(3s) fopen(3s)
Name
fopen, freopen, fdopen - open a stream
Syntax
#include <stdio.h>
FILE *fopen (filename, type)
char *filename, *type;
FILE *freopen (filename, type, stream)
char *filename, *type;
FILE *stream;
FILE *fdopen (fildes, type)
int fildes;
char *type;
Description
The routine opens the file named by filename and associates a stream with it. The routine returns a pointer to the FILE structure associ-
ated with the stream.
The filename points to a character string that contains the name of the file to be opened.
The type is a character string having one of the following values:
"r" Open for reading
"w" Truncate or create for writing
"a" Append; open for writing at end of file, or create for writing
"A" Append with no overwrite; open for writing at end-of-file, or create for writing
"r+" Open for reading and writing
"w+" Truncate or create for reading and writing
"a+" Append; open or create for reading and writing at end-of-file
"A+" Append with no overwrite, open or create for update at end-of-file
The letter "b" can also follow r, w, or a. In some C implementations, the "b" is needed to indicate a binary file, however, it is not
needed in ULTRIX. If "+" is used, the "b" may occur on either side, as in "rb+" or "w+b".
The routine substitutes the named file in place of the open stream. The original stream is closed, regardless of whether the open ulti-
mately succeeds. The routine returns a pointer to the FILE structure associated with stream.
The routine is typically used to attach the preopened streams associated with stdin, stdout and stderr to other files.
The routine associates a stream with a file descriptor. File descriptors are obtained from or which open files but do not return pointers
to a FILE structure stream. Streams are necessary input for many of the Section 3s library routines. The type of stream must agree with
the mode of the open file.
When a file is opened for update, both input and output may be done on the resulting stream. However, output may not be directly followed
by input without an intervening or and input may not be directly followed by output without an intervening or an input operation which
encounters end-of-file.
When a file is opened for append with no overwrite (that is when type is "A" or "A+"), it is impossible to overwrite information already in
the file. The routine may be used to reposition the file pointer to any position in the file, but when output is written to the file, the
current file pointer is disregarded. All output is written at the end of the file and causes the file pointer to be repositioned at the
end of the output. If two separate processes open the same file for append, each process may write freely to the file without fear of
destroying output being written by the other. The output from the two processes will be intermixed in the file in the order in which it is
written.
Return Values
The and routines return a NULL pointer on failure.
Environment
SYSTEM_V
When your program is compiled using the System V environment, append with no overwrite is specified by using the "a" or "a+" type string,
and the "A" and "A+" type strings are not allowed.
POSIX
In the POSIX environment, the "a" and "a+" strings, and the "A" and "A+" strings specify append with no overwrite.
See Also
creat(2), dup(2), open(2), pipe(2), fclose(3s), fseek(3s).
fopen(3s)