01-03-2017
Quote:
Originally Posted by
Simplify
I was not aware of KSH - so on your mention i went and had a quick read - I like it! So i have installed it and will start doing some scripting using korn and see how I go :-)
Yes! One more converted! ;-)
Seriously: i am glad you like it. What i appreciate most about Korn Shell is the possibilty to set the variable FPATH, which works similar to PATH - though not for binaries but shell functions. This way you can designate a directory with functions written in shell which you can use from any of your scripts. This way i built a "library" over the years with functions for repetitive tasks: writing a log, create/remove space for temporary files, check if the script is run with root authority ....
Quote:
Originally Posted by
Simplify
I may have to ask you for some more tips from time to time in the future ;-)
You are welcome. Ask as much as you wish. Here is a tip you haven't asked: Barry Rosenberg, "KornShell Programming Tutorial" and "Hand-On KornShell93 Programmming". These are not only very good books about the topic but also great fun to read. You might want to give them a try.
I hope this helps.
bakunin
This User Gave Thanks to bakunin For This Post:
7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies
2. Shell Programming and Scripting
hi All,
I have the following two requirements:
case 1:
In a file i have the below code:
if ((a>b)) a=b;
else a = c;
by using some means i need to convert the line to the following output:
Output required:
case 2:
In a file i have the below code:
if (a>b)
a=b;
else
a... (4 Replies)
Discussion started by: engineer
4 Replies
3. Shell Programming and Scripting
I have a file (file1) with in the below format
ST*820*212121
BPR*C*213212.20*C*212*CCD*01***01*071000013*DA*321321*101208
TRN*1*21321321*13213
N1*PR*3232. dff. SYS.*91*3232
ENT*1
N1*PE* 2132121321
RMR*TN*234456677888**192387.20*192387.20
REF*IV*234456677888*213213 3213 UNI... (0 Replies)
Discussion started by: Muthuraj K
0 Replies
4. Shell Programming and Scripting
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies
5. UNIX for Dummies Questions & Answers
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
#masterscript.sh
./callingscript.sh
echo $fileExist
#callingscript.sh
echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies
6. Shell Programming and Scripting
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies
7. Shell Programming and Scripting
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Discussion started by: siegfried
3 Replies
LEARN ABOUT OSX
net::ldap::control::postread
Net::LDAP::Control::PostRead(3) User Contributed Perl Documentation Net::LDAP::Control::PostRead(3)
NAME
Net::LDAP::Control::PostRead - LDAPv3 Post-Read control object
SYNOPSIS
use Net::LDAP;
use Net::LDAP::Control::PostRead;
use Net::LDAP::Constant qw( LDAP_CONTROL_POSTREAD LDAP_SUCCESS );
$ldap = Net::LDAP->new( "ldap.mydomain.eg" );
$postread = Net::LDAP::Control::PostRead->new( attrs => [ qw/givenName/ ] );
my $mesg = $ldap->modify( "cn=Barbara Jensen, o=University of Michigan, c=US",
replace => { givenName => "Babs" },
control => $postread );
if ($mesg->code eq LDAP_SUCCESS) {
my ($afterwards) = $mesg->control( LDAP_CONTROL_PREREAD );
my $entry = $afterwards ? $afterwards->entry() : undef;
if ($entry) {
print "givenName changed to '" .
join("', '", $entry->get_value(givenName") .
"' to 'Babs'
");
}
}
DESCRIPTION
"Net::LDAP::Control::PostRead" provides an interface for the creation and manipulation of objects that represent the "Post-Read Controls"
as described by RFC 4527.
In modification operations, the "Post-Read request control" indicates to the server that a copy of the modified entry after the update is
to be returned. After the successful completion of the operation, the accompanying "Post-Read response control" allows one to retrieve the
updated value from the servers's response.
One use case of this control may be to obtain values of operational attributes, such as the "entryUUID" and "modifyTimestamp" attributes,
updated by the server as part of the update operation.
CONSTRUCTOR ARGUMENTS
In addition to the constructor arguments described in Net::LDAP::Control the following are provided.
attrs => [ ATTR, ... ]
A list of attributes to be returned in the entry returned in the response control.
If absent, all attributes are returned.
Operational attributes may be included in the list by explicitly asking for them or by using special "+" feature (provided the server
supports this feature).
METHODS
As with Net::LDAP::Control each constructor argument described above is also available as a method on the object which will return the
current value for the attribute if called without an argument, and set a new value for the attribute if called with an argument.
In addition to these methods, the control also supports the following method:
entry ()
Returns the entry from the response control in the response message to the LDAP request that contained the request control.
The result is either a Net::LDAP::Entry object or undefined.
SEE ALSO
Net::LDAP, Net::LDAP::Control, http://www.ietf.org/rfc/rfc4527.txt
AUTHOR
Peter Marschall <peter@adpm.de>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>
COPYRIGHT
Copyright (c) 2008,2011 Peter Marschall. All rights reserved. This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
perl v5.16.2 2012-09-20 Net::LDAP::Control::PostRead(3)