05-31-2005
read file line by line and use strtok(), if user names are seperated by space. and then use strcmp() with each token to compare user names.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I'm new to perl,
My requirement is to check if particular file exists.
e.g. filename.txt, filename1.txt, filename2.txt etc
I tried the below code:-
my $var1 = "filename.txt"
if ( -e ($var1 = ~ /file\w/))
{
print "File found \n";
}
else
{ print "File not found \n";
}
... (0 Replies)
Discussion started by: doitnow
0 Replies
2. Shell Programming and Scripting
Hi all
I have a file with below content (content is variable whenever new product is launched). I need form a grep command like this
egrep "Unknown product|Invalid symboland so on"
How to do it using a script?
Unknown product
Invalid symbol
No ILX exch found
exceeds maximum size
AFX... (4 Replies)
Discussion started by: johnl
4 Replies
3. Programming
Hi,
I have large files with fixed length fields or fields seperated by delimeter. I would like to do validation on some or all fields to check for numeric or date or characters etc.. I would like to write this in C++. Please let me know if any one have any ideas on this.
Thanks for all... (2 Replies)
Discussion started by: rameshmelam
2 Replies
4. Shell Programming and Scripting
Hi all,
I would like to print words in a file seperated by whitespaces containing a specific pattern like "="
e.g. I have a file1 containing strings like
%cat file1
The= some= in
wish= born
<eof> .I want to display only those words containing = i.e The= , some=,wish=
... (5 Replies)
Discussion started by: sree_123
5 Replies
5. UNIX for Dummies Questions & Answers
I have a file with words that begin with character #. Whenver that character is found that word should be deleted throughout the file. How do I do that in VIM.
e.g:
afkajfa ladfa ljafa #222222 kjafad ljl
afajkj kjlj uouu #44444 jlkj lkjl
Output should be
afkajfa ladfa ljafa kjafad... (1 Reply)
Discussion started by: osbourneric
1 Replies
6. Shell Programming and Scripting
Hi,
file -> temp.txt
cat temp.txt
/home/pradeep/123/a_asp.html
/home/pradeep/123/a_asp1.html
/home/pradeep/435/a_asp2.html
/home/pradeep/arun/abc/a_dfr.html
/home/pradeep/arun/123/a_kir.html
/home/pradeep/123/arun/a_dir.html
....
....
..
i need to get a_*.html(bolded strings... (4 Replies)
Discussion started by: pradebban
4 Replies
7. Shell Programming and Scripting
Hello dear Unix shell professionals,
I am desperately trying to get a seemingly simple logic to work. I need to extract words from a text line and save them in an array. The text can look anything like that:
aaaaaaa${important}xxxxxxxx${important2}ooooooo${importantstring3}...I am handicapped... (5 Replies)
Discussion started by: Grünspanix
5 Replies
8. Shell Programming and Scripting
Hi Guys..
I have a file and i want to extract all words that starts with a pattern 'ABC_' or 'ADF_'
For example,
ABC.txt
----
INSERT INTO ABC_DLKFJAL_FJKLD
SELECT DISTINCT S,B,C FROM ADF_DKF_KDFJ_IERU8 A, ABC_LKDJFREUE9_FJKDF B
WHERE A.FI=B.EI;
COMMIT;
Output : ABS_DLKFJAL_FJKLD,... (5 Replies)
Discussion started by: Pramod_009
5 Replies
9. Shell Programming and Scripting
Hi
I need to do a patten match between files .
I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time.
Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies
10. UNIX for Beginners Questions & Answers
I have file1 and file2 as shown below,
file1:
((org14/1-131541:0.11535,((org29/1-131541:0.00055,org7/1-131541:0.00055)1.000:0.10112,((org17/1-131541:0.07344,(org23/1-131541:0.07426,((org10/1-131541:0.00201,org22/1-131541:0.00243)1.000:0.02451,
file2:
org14=india
org29=america... (5 Replies)
Discussion started by: dineshkumarsrk
5 Replies
LEARN ABOUT ULTRIX
mtstailor
mtstailor(5mh) mtstailor(5mh)
Name
mtstailor - system customization for MH message system
Description
The file defines run-time options for those MH programs which interact (in some form) with the message transport system. At present, these
(user) programs are: and
The options available along with default values and a description of their meanings are listed below:
The host name that MH considers local.
If not set, depending on the version of ULTRIX you are running, MH will query the system for this value (for example: <whoami.h>,
gethostname). This has no equivalent in the MH configuration file.
The name of the local host in the UUCP "domain".
If not set, depending on the version of ULTRIX you are running, MH will query the system for this value. This has no equivalent
in the MH configuration file.
A host or list of hosts running
can be specified. When an MH program is run, it uses this entry to search for a central to connect to. This is particularly
useful for workstation users who may not have running on their workstation.
The directory where maildrops are kept.
If this is empty, the user's home directory is used. This overrides the mail field in the MH configuration file.
The name of the maildrop file in the directory where maildrops are kept.
If this is empty, the user's login name is used. This overrides the mail field in the MH configuration file.
The beginning-of-message delimiter for maildrops.
The end-of-message delimiter for maildrops.
If non-zero, then support for MMailids in
is enabled. Basically, the field in the password file is of the form
My Full Name <mailid>
The MH internal routines that deal with user and full names will return mailid and My Full Name respectively.
The locking discipline to perform.
A value of 0 means to use if available, standard locking otherwise. A value of 1 means to use locking always (the name of the
lock is based on the file name). A value of 2 means to use locking always (the name of the lock is based on device/inode pairs).
The name of the directory for making locks.
If your system does not have the syscall, then this directory is used when creating locks. If the value is empty, then the
directory of the file to be locked is used.
The pathname to the
program.
The name of the system-wide default
file. See for the details.
The highest user-id which should NOT receive mail addressed to
everyone.
If set, then each user-id greater than everyone
that has a login shell equivalent to the given value (for example, indicates that mail for everyone should not be sent to them.
This is useful for handling admin, dummy, and guest logins.
A few words on locking: MH has a flexible locking system for making locks on files. There are two variables you should be aware of: lock-
style and lockldir. The first controls the method of locking: the second says where lock files should be created.
The lockstyle variable can take on three values: 0, 1, 2. A value of 0 means use the syscall if you are running on 4.2BSD, otherwise use a
locking style of 1. A value of 1 or 2 specifies that a file should be created whose existence means locked and whose non-existence means
unlocked. A value of 1 specified that the lockname is constructed by appending to the name of the file being locked.
A value of 2 says to construct the lockname by looking at the device and inode numbers of the file being locked. If the lockldir variable
is not specified, lock files will be created in the directory where the file being locked resides. Otherwise, lock files will be created
in the directory specified by lockldir. Prior to installing MH, you should see how locking is done at your site, and set the appropriate
values.
Files
System customization file.
System password file.
See Also
flock(2), mh_profile(5mh)
mtstailor(5mh)