This is my first post to this group.I am new to Unix.I have one requirement
I need to replace a text in all the files in a directory and sub-directory.Eg i have a folder structure like /usr/local/abc , inside abc i have several directories and several files. All the files inside abc and all the... (1 Reply)
Please Help... I am trying to manipulte the following line
Before :
<user:Account_Password>002786</user:Account_Password>
the password is the "variable", i need to delete / omit the password in the file, (it occurs several thousand times)
so the tag line looks like
After:... (4 Replies)
Hi,
I have a few thousand files, each contains the word "hello". Would it be possible to do a batch job that replaces the word hello with the filename?
Thanks. (2 Replies)
I was google searching and found
Perl as a command line utility tool
This almost solves my problem:
find . | xargs perl -p -i.old -e 's/oldstring/newstring/g'
I think this would create a new file for every file in my directory tree. Most of my files will not contain oldstring and I... (1 Reply)
Hi,
I have a situation where I want to replace some occurrences of ".jsp" into ".html" inside a text file.
For Example:
If a pattern found like <a href="http://www.mysite.com/mypage.jsp"> it should be retained.
But if a pattern found like <a href="../mypage.jsp"> it should be changed to... (4 Replies)
Hi All,
I want to change the name as SEQ_13
ie., <Property Name="Name">SEQ_13</Property>
when the Stage Type is PxSequentialFile
ie., <Property Name="StageType">PxSequentialFile</Property> :wall:
Input.XML
<Main>
<Record Identifier="V0S13" Type="CustomStage" Readonly="0">... (3 Replies)
Hi all,
Please somebody help me with this:
I want to check if the files listed in a text file, are found under a directory or not.
For example: the file is list_of_files.txt, which contains inside this rows:
# cat list_of_files
logs
errors
paths
debug
#
I want to check if these... (3 Replies)
I have a directory that is restricted and I cannot just copy the files need, but I can cat them and redirect them to a new directory. The files all have the date listed in them. If I perform a long listing and grep for the date (150620) I can redirect that output to a text file. Now I need to... (5 Replies)
I wish to list only files along with the absolute path in a given directory on my AiX 6.1 system.
Below is the best I could do.
ls -p "/app/scripts"/*
This gives a a list of all filename along with folder names with absolute path non-recurrsive (without listing files in sub-directories)... (1 Reply)
Discussion started by: mohtashims
1 Replies
LEARN ABOUT PLAN9
dirread
DIRREAD(2) System Calls Manual DIRREAD(2)NAME
dirread - read directory
SYNOPSIS
#include <u.h>
#include <libc.h>
int dirread(int fd, Dir *buf, long nbytes)
DESCRIPTION
The data returned by a read(2) on a directory is a set of complete directory entries in a machine-independent format, exactly equivalent to
the result of a stat(2) on each file or subdirectory in the directory. Dirread decodes the directory entries into a machine-dependent
form. It reads from fd and unpacks the data into Dir structures in buf (see stat(2) for the layout of a Dir). Nbytes is the size of buf;
it should be a multiple of sizeof(Dir). Directory entries have length DIRLEN (defined in <libc.h>) in machine-independent form. A suc-
cessful read of a directory always returns a multiple of DIRLEN; dirread always returns a multiple of sizeof(Dir).
Dirread returns the number of bytes filled in buf; the number returned may be less than the number requested. The file offset is advanced
by the number of bytes actually read.
SOURCE
/sys/src/libc/9sys/dirread.c
SEE ALSO intro(2), open(2), read(2)DIAGNOSTICS
Sets errstr.
DIRREAD(2)