01-23-2019
Thanks RudiC...
That makes sense, I can see it in my minds eye now.
Sorry to tie up this thread with that question but it is useful for our new friend to know.
<Thumbs Up>
This User Gave Thanks to wisecracker For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Okay, well this is more or less my first attempt at writing a shell script.
Anyways, here's my code:
cd ${PATH}
if
then
rm ${FILE}
./anotherScript
else
exit 1
fi
exit 1
Anyways, it's a pretty simple script that is supposed to search for the... (4 Replies)
Discussion started by: cbo0485
4 Replies
2. UNIX for Dummies Questions & Answers
Hello, i have a script which checks if the user entered 8 numeric characters in the form of YYYYMMDD (birth date). If the user entered any non numeric characters, an error will be displayed:
# Check to see if the 8 characters are all numbers
# If not show error essage
# And prompt user... (4 Replies)
Discussion started by: netmaster
4 Replies
3. Shell Programming and Scripting
Hi,
I want to use grep inside a test statement, but I am getting an error message.
Two variables
testvarNum=5
testvarNonNum=x
echo $testvarNum | grep *
The result of this is as follows:
5
However, when I try the following (i.e. to test if the variable is numeric or non-numeric):... (3 Replies)
Discussion started by: dkieran
3 Replies
4. Shell Programming and Scripting
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Discussion started by: Max89
1 Replies
5. Shell Programming and Scripting
Hello ...again.
I am stuck on this part, I have a loop with processes an operations file.
and calls different functions depending on what is in loop, which processes a database file...
#so far my add function works as intended
add()
{
...blah blah;
}
# delete is kinda working... (13 Replies)
Discussion started by: gcampton
13 Replies
6. Shell Programming and Scripting
How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies
7. Shell Programming and Scripting
Hello,
I have a problem. I will search files on fileextentions (suffix). It can with the command find, but I will do it with the commands grep and/or test. When i start the script I will see all files with that extention (suffix).
Can anyone help me, please?
Thanks!
Regards,
Arjan... (4 Replies)
Discussion started by: arjanengbers
4 Replies
8. Shell Programming and Scripting
Hi all. I am trying to compare and filter two files. I have a bigfile.txt of names and ids and a smallfile.txt of ids only. What I am trying to do is use a while read loop to read the ids in the bigfile and then echo the name and id only if the id exists in the small file. Basically, I'm trying to... (5 Replies)
Discussion started by: jameswatson3
5 Replies
9. Shell Programming and Scripting
cat abc.txt
Filename: SHA_AED_Monthly_SNR_20150331.txt.gz
Data Format: ASCII with carriage returns and linefeeds
Compression: GZIP
GZIP Bytes: 36893068
Unzipped Bytes : 613794510
Records: 851310
Record Length: 738
Blocksize: 32472
Filename: SHA_AED_SNR_ChangeLog_20150331.txt.gz
Data... (16 Replies)
Discussion started by: dotran
16 Replies
10. UNIX for Beginners Questions & Answers
read a
if test grep EOF $a
then echo yes file
else
echo no
fi (1 Reply)
Discussion started by: iamsumibisht
1 Replies
LEARN ABOUT MOJAVE
sdbm_file
SDBM_File(3pm) Perl Programmers Reference Guide SDBM_File(3pm)
NAME
SDBM_File - Tied access to sdbm files
SYNOPSIS
use Fcntl; # For O_RDWR, O_CREAT, etc.
use SDBM_File;
tie(%h, 'SDBM_File', 'filename', O_RDWR|O_CREAT, 0666)
or die "Couldn't tie SDBM file 'filename': $!; aborting";
# Now read and change the hash
$h{newkey} = newvalue;
print $h{oldkey};
...
untie %h;
DESCRIPTION
"SDBM_File" establishes a connection between a Perl hash variable and a file in SDBM_File format;. You can manipulate the data in the file
just as if it were in a Perl hash, but when your program exits, the data will remain in the file, to be used the next time your program
runs.
Use "SDBM_File" with the Perl built-in "tie" function to establish the connection between the variable and the file. The arguments to
"tie" should be:
1. The hash variable you want to tie.
2. The string "SDBM_File". (Ths tells Perl to use the "SDBM_File" package to perform the functions of the hash.)
3. The name of the file you want to tie to the hash.
4. Flags. Use one of:
"O_RDONLY"
Read-only access to the data in the file.
"O_WRONLY"
Write-only access to the data in the file.
"O_RDWR"
Both read and write access.
If you want to create the file if it does not exist, add "O_CREAT" to any of these, as in the example. If you omit "O_CREAT" and the
file does not already exist, the "tie" call will fail.
5. The default permissions to use if a new file is created. The actual permissions will be modified by the user's umask, so you should
probably use 0666 here. (See "umask" in perlfunc.)
DIAGNOSTICS
On failure, the "tie" call returns an undefined value and probably sets $! to contain the reason the file could not be tied.
"sdbm store returned -1, errno 22, key "..." at ..."
This warning is emitted when you try to store a key or a value that is too long. It means that the change was not recorded in the
database. See BUGS AND WARNINGS below.
BUGS AND WARNINGS
There are a number of limits on the size of the data that you can store in the SDBM file. The most important is that the length of a key,
plus the length of its associated value, may not exceed 1008 bytes.
See "tie" in perlfunc, perldbmfilter, Fcntl
perl v5.18.2 2014-01-06 SDBM_File(3pm)