04-27-2006
please can any one help me bundle several files into one
#!/bin/sh
#call function from loop
filevalidate()
{
case $# in
0) echo "usage enshar file1 file2 ... > outputfile ! " >/deb/sterr ;;
*) for filename
do
if [ $filename -gt 1 ]; then
echo "invalid pathname > try bin " $filename >/dev/stderr
exit 1
fi
if [ -d $filename ]; then
echo "is a directory!" $filename >/dev/stderr
exit 2
fi
if [ ! -r $filename ] || [ ! -f $filename ]; then
echo "unreadable or non existant " $filename >/dev/stderr
exit 3
fi
grep -- "^!EnShAr!" "$filename"
if [ $? -eq 0 ]; then
echo "cant enshar it or already enshared! " $filename >/dev/stderr
exit 5
fi
if [ $filename = "" ]; then
echo "usage is enshar file1 file2 .. > outputfile" >/dev/stderr
exit 6
fi
done ;;
esac
}
for filename in $*
do
filevalidate $filename
done
for filename in $*
do
echo cat \>$filename \<\<"\\!EnShAr!"
cat <$filename
echo "!EnShAr!"
echo set \`cksum $filename\`
set `cksum $filename`
echo "test \$filename = $filename || echo \$0: BAD checksum in
$filename >&2"
done
exit 0
#this is what i have so far and only works 80%
#kind regards
9 More Discussions You Might Find Interesting
1. HP-UX
Hi, I need to install these 7 patches on my server:
and the below are the 5 dependency to install these patches
1. PHNE_31097;
1(a). PHCO_33205 (dependency)
b(a). PHCO_30398 (dependency)
2. PHSS_32508;
3. PHSS_32509;
4. PHSS_32510;
5. PHSS_30970;
6. PHSS_32731;
6(a). PHNE_28810... (2 Replies)
Discussion started by: vipsinghal
2 Replies
2. Solaris
Hello,
I am working on patching several systems and have begun working with smpatch as a possibly quicker way to accomplish patching. I have some observations that trouble me.
The "smpatch analyze" only shows a small number of patches for a system (yes the registration is complete with a... (0 Replies)
Discussion started by: justme3
0 Replies
3. AIX
Hi.
I forgot a bundle (X11.dt) in the lpp_source (base OS AIX 7.1). The bundle is now in the CD drive, I need to add it permanently in the lpp_source. What do I have to do ?
- copy (where ?) bundle on my NIM server (how to determine what files to copy to have all elements of the bundle ?) ?... (1 Reply)
Discussion started by: stephnane
1 Replies
4. Shell Programming and Scripting
Hi,
Below is the scneario
a.txt
b.txt
c.txt .......
i have written a script to zip these files & the output after executing script is
a.txt.zip
b.txt.zip
c.txt.zip
but i dnt want to zip each individual files it has to done in bundle.
EX:A zip folder has to be created ,lets say... (2 Replies)
Discussion started by: jagadeeshn04
2 Replies
5. HP-UX
Hi all.
I'm wondering if there's a install sequence in a HPUX bundle?
I'm trying to put many depots together into 1 single bundle, and use HPUX ignite to install this bundle.
But I have to make sure one of the depot is last installed.
I feel that if there're many different packages in a bundle,... (0 Replies)
Discussion started by: baibinghere
0 Replies
6. Shell Programming and Scripting
I have a file of lot of perl modules in tar.gz format. They all have dependency on each other for installation.
Can anybody guide me for making a bundle so that I can run it in one go and install all the modules.
Please note that I can't use CPAN as we don't have Internet connectivity on our... (3 Replies)
Discussion started by: nixhead
3 Replies
7. AIX
if I want to create a bundle of user ids on some aix servers, if there is a way not need to do "passwd username" one by one user to set the password?
Thanks (3 Replies)
Discussion started by: rainbow_bean
3 Replies
8. Shell Programming and Scripting
I do have a big CA bundle certificate file and each time if i get request to add new certificate to the existing bundle i need to make sure it is not present already. How i can validate the duplicates.
The alignment of the certificate within the bundle seems to be different.
Example:
Cert 1... (7 Replies)
Discussion started by: diva_thilak
7 Replies
9. Emergency UNIX and Linux Support
Hi,
I have an issue with openssl. Basically I have a ca certificate which has expired and I have regenerated a new ca.cert from the ca.key file and I have concatenated the output of the new ca.crt file and ca-bundle.crt to a new ca-bundle.crt.
Have restarted apache, however I still get the... (1 Reply)
Discussion started by: maverick_here
1 Replies
EXIT(3) 1 EXIT(3)
exit - Output a message and terminate the current script
SYNOPSIS
void exit ([string $status])
DESCRIPTION
void exit (int $status)
Terminates execution of the script. Shutdown functions and object destructors will always be executed even if exit is called.
exit is a language construct and it can be called without parentheses if no $status is passed.
PARAMETERS
o $status
- If $status is a string, this function prints the $status just before exiting. If $status is an integer, that value will be used
as the exit status and not printed. Exit statuses should be in the range 0 to 254, the exit status 255 is reserved by PHP and
shall not be used. The status 0 is used to terminate the program successfully.
Note
PHP >= 4.2.0 does NOT print the $status if it is an integer.
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
exit example
<?php
$filename = '/path/to/data-file';
$file = fopen($filename, 'r')
or exit("unable to open file ($filename)");
?>
Example #2
exit status example
<?php
//exit program normally
exit;
exit();
exit(0);
//exit with an error code
exit(1);
exit(0376); //octal
?>
Example #3
Shutdown functions and destructors run regardless
<?php
class Foo
{
public function __destruct()
{
echo 'Destruct: ' . __METHOD__ . '()' . PHP_EOL;
}
}
function shutdown()
{
echo 'Shutdown: ' . __FUNCTION__ . '()' . PHP_EOL;
}
$foo = new Foo();
register_shutdown_function('shutdown');
exit();
echo 'This will not be output.';
?>
The above example will output:
Shutdown: shutdown()
Destruct: Foo::__destruct()
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
Note
This language construct is equivalent to die(3).
SEE ALSO
register_shutdown_function(3).
PHP Documentation Group EXIT(3)