9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a source file with data
Name ~ Groups
Muni~abc,was,USA_ax,123
Chaitanya~USA_12,was
Balaji~123,xyz,was
Ramu~123,xyz
From the second column i want to extract only the groups that matches the pattern 'USA_%' or if the group = 'was', and ignore any other columns.
... (8 Replies)
Discussion started by: morbid_angel
8 Replies
2. Shell Programming and Scripting
Hi all,
I have little working knowledge in unix shell scripting. I have a requirement where i need to pull out some data in between the strings in the file.
Input:
TEST
a
a
c
f
d
TEST
f
e
g
g
TEST
Output: (7 Replies)
Discussion started by: satyasrin82
7 Replies
3. Programming
Hi everyone
I am developing an utility.
At some part of it I read directory entries to a dynamic array: struct list
It stores pointers to items: list.entries,
which are structures: struct entry
If a number of files in a directory is greater then number of elements an array was initially... (11 Replies)
Discussion started by: torbium
11 Replies
4. SuSE
Dear Experts,
i am trying to find whether the given name is file or a directory
dirp = opendir(dirname);
direntp = readdir(dirp);
if(direntp->d_type & DT_DIR)
{
printf("\n is a dirctory");
}
else
{
//dir_or_file = Mtrue;
printf("\n not a directory");
}
it always... (9 Replies)
Discussion started by: vin_pll
9 Replies
5. Shell Programming and Scripting
Quick question.
I can not get the context corrert on this code.
opendir(DIR, ".");
@fileldiv = grep(/l*/,readdir(DIR));
closedir(DIR);
I am trying to search all html files within a dir that start with l.
Thanks for your help. (1 Reply)
Discussion started by: mrlayance
1 Replies
6. Shell Programming and Scripting
I am trying to script and came up with a conclusion that I need a do while loop in my statement. I am stuck with the
do while syntax. I need to use it alongwith the if then else statement. Can I use it is a big question? I actually need to get all the files
that are there from within run_dt to... (1 Reply)
Discussion started by: aronmelon
1 Replies
7. Programming
I am having a hard time doing this and can't seem to find an example to help me. This is my code:
DIR *dirp=opendir(pathname);
struct stat filebuf;
struct dirent entry;
struct dirent *dp=&entry;
RWCString pattern;
for (int i = 0; i < request_->getNumStreams(); i++)
{
... (2 Replies)
Discussion started by: ajgwin
2 Replies
8. UNIX for Dummies Questions & Answers
I read the description of the command readdir by using 'man readdir'. However, in the description i was suggesed to refer to readdir(3).
I wonder how to see the manual of readdir(3)
Thanks (1 Reply)
Discussion started by: cy163
1 Replies
9. Filesystems, Disks and Memory
I am trying to read the directory contents throgh the readdir system call.
After getting the directory entry I am testing the type of it by using the folllowing macros S_ISDIR() S_ISREG() etc. But in some systems every file in the directory is displaying like a sub directory. and in some systems... (2 Replies)
Discussion started by: gandhevinod
2 Replies