04-03-2012
Also: It is seldom a good idea to write to the same file you're reading from. Try writing to a different file.
This User Gave Thanks to Corona688 For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi--
Ok. I have now found that:
find -x -ls
will do what I need as far as finding all files on a particular volume. Now I need to sort the results by the file's modification date/time.
Is there a way to do that?
Also, I notice that for many files, whereas the man for find says ls is... (8 Replies)
Discussion started by: groundlevel
8 Replies
2. UNIX for Dummies Questions & Answers
Hello! Can anybody explain in laymen terms what the (+) option in the sort command for Linux does? Please.
Thanks in advance!!:D (1 Reply)
Discussion started by: itisijayare
1 Replies
3. Shell Programming and Scripting
Here is the code, but the list is not sorted properly (alphabetically)?
<?php
function folderlist(){
$startdir = './';
$ignoredDirectory = '.';
$ignoredDirectory = '..';
if (is_dir($startdir)){
if ($dh = opendir($startdir)){
while (($folder = readdir($dh)) !== false){
if... (0 Replies)
Discussion started by: mrlayance
0 Replies
4. UNIX for Dummies Questions & Answers
cat a
.a
ba
.b
bb
.c
bc
sort a
.a
.b
ba
bb
bc
.c
NOTE: .a and .b appears before ba and bb, where as .c appears after bc.
In general (3 Replies)
Discussion started by: ajb
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a problem with a shell script.
The script should find all .cpp and .h files and list them.
With:
for file in `find $src -name '*.h' -o -name '*.cpp'
it gives out this:
H:\FileList\A\E\F\G\newCppFile.cpp
H:\FileList\header01.h
H:\FileList\B\nextCppFile.cpp
... (4 Replies)
Discussion started by: shellBeginner75
4 Replies
6. Linux
Iam working on centos os. Iam not able to sort records without option
Please help me out
Jayaprakash B. (1 Reply)
Discussion started by: jpachar
1 Replies
7. Homework & Coursework Questions
This is the question being asked: (Sort your data file by last name first, then by the first name second - save as first_last.) I am not quite sure of the type of sort I am being asked to perform. I have read the man pages of the sort command a few times, as well as searching online for possible... (10 Replies)
Discussion started by: demet8
10 Replies
8. UNIX for Advanced & Expert Users
Hi,
I am having a text file with the following contents
###########
File1
###########
some
page1.txt
text
page.txt
When I sort this file on Red Hat 5, then I get the following output
###########
File1
###########
page1.txt
page.txt
some (3 Replies)
Discussion started by: sarbjit
3 Replies
9. UNIX for Beginners Questions & Answers
Hi Folks -
I have this file that looks like this:
outbox/logs/Client_1042.log
outbox/logs/Client_941.log
outbox/logs/Client_942.log
outbox/logs/Client_943.log
outbox/logs/Client_944.log
And this is my code:
#!/bin/bash
_OUTBOX_BIN="outbox/logs/"
_NAME="Client"
_TEMP="temp.txt"... (9 Replies)
Discussion started by: SIMMS7400
9 Replies
10. UNIX for Beginners Questions & Answers
Could you please advise on the following: I have two space-delimited files with 9 and 10 columns, respectively, with exactly the same values in column 1. However, the order of column 1 differs between the two files, so I want to sort both files by column 1, so that I can align them and... (6 Replies)
Discussion started by: aberg
6 Replies
LEARN ABOUT CENTOS
tcl_getopenfile
Tcl_GetOpenFile(3) Tcl Library Procedures Tcl_GetOpenFile(3)
__________________________________________________________________________________________________________________________________________________
NAME
Tcl_GetOpenFile - Return a FILE* for a channel registered in the given interpreter (Unix only)
SYNOPSIS
#include <tcl.h>
int
Tcl_GetOpenFile(interp, chanID, write, checkUsage, filePtr)
ARGUMENTS
Tcl_Interp *interp (in) Tcl interpreter from which file handle is to be obtained.
const char *chanID (in) String identifying channel, such as stdin or file4.
int write (in) Non-zero means the file will be used for writing, zero means it will be used for reading.
int checkUsage (in) If non-zero, then an error will be generated if the file was not opened for the access indicated by
write.
ClientData *filePtr (out) Points to word in which to store pointer to FILE structure for the file given by chanID.
_________________________________________________________________
DESCRIPTION
Tcl_GetOpenFile takes as argument a file identifier of the form returned by the open command and returns at *filePtr a pointer to the FILE
structure for the file. The write argument indicates whether the FILE pointer will be used for reading or writing. In some cases, such as
a channel that connects to a pipeline of subprocesses, different FILE pointers will be returned for reading and writing. Tcl_GetOpenFile
normally returns TCL_OK. If an error occurs in Tcl_GetOpenFile (e.g. chanID did not make any sense or checkUsage was set and the file was
not opened for the access specified by write) then TCL_ERROR is returned and the interpreter's result will contain an error message. In
the current implementation checkUsage is ignored and consistency checks are always performed.
Note that this interface is only supported on the Unix platform.
KEYWORDS
channel, file handle, permissions, pipeline, read, write
Tcl 8.0 Tcl_GetOpenFile(3)