How to write this condition in ksh?
if myfile is empty or myfile does not exist
then
do action1
fi
is this OK?
if ] -o ] then
then
do action1
fi
Thanks. (3 Replies)
Hi,
Plz suggest me how can i change the date of a file.
Suppose my file has been created in some date and i want to give it present date.
How can i do this???? (2 Replies)
hi all,
i want use the variable value as a new variable name. print output of new variable.
for i in COMPUTER1 COMPUTER2
do
flag_name=${i}_FLAG
eval ${flag_name}=123
echo $i'_FLAG'
done
output is
COMPUTER1_FLAG
COMPUTER2_FLAG
i need output as
123
123 (2 Replies)
Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for.
Anyway, I'm in the process of self-teaching... (1 Reply)
Hi.
How to change string variable in awk?
for example, I parse with awk script text file named some_name_with_extension.txt
I want to print only some_name in my script
....
varCompName = FILENAME
print varCompName
How to put not all symbols from FILENAME to variable?
thank you
This... (4 Replies)
Hey Guys,
I have text such as this.
28003,ALCORN,2
28009,BENTON,2
28013,CALHOUN,2
28017,CHICKASAW,2
47017,CARROLL,2
05021,CLAY,0
The last digit after the final "," is a variable value. This is the base file. I have to do further execution on this file later and I need to update the... (7 Replies)
I feel like it is just a matter of using the $ operators correctly, but I can't seem to get it...
hostname="network"
ip="192.168.1.1"
netmask=""
variables=( $hostname $ip $netmask )
for var in ${variables}
do
if ; then
$var="--"
fi
done
echo... (7 Replies)
Hi,
This is the first time I see something like this, and I don't why it happens.
Please give me some help. I am really appreciate it.
Basically I am trying to remove all empty lines of an input..
#!/bin/bash
set -e
set -x
str1=`echo -e "\nhaha" | grep -v ^$`
#str2=`echo -e "\n" |... (4 Replies)
I have a file hello.txt which was created today (today's date timestamp)
I wish to change its date timestamp (access, modified, created) to 1 week old i.e one week from now.
uname -a
SunOS mymac 5.11 11.2 sun4v sparc sun4v
Can you please suggest a easy way to do that ? (12 Replies)
Discussion started by: mohtashims
12 Replies
LEARN ABOUT DEBIAN
webkdc
WebKDC(3pm) User Contributed Perl Documentation WebKDC(3pm)NAME
WebKDC - functions to support the WebKDC
SYNOPSIS
use WebAuth;
use WebKDC;
use WebKDC::Exception;
use WebKDC::WebRequest;
use WebKDC::WebResponse;
my ($status, $exception) =
WebKDC::make_request_token_request($req, $resp);
DESCRIPTION
WebKDC is a set of convenience functions built on top of mod WebAuth to implement the WebKDC.
All functions have the potential to throw either a WebKDC::WebKDCException or WebAuth::Exception.
EXPORT
None
FUNCTIONS
make_request_token_request(req,resp)
($status, $e) = WebKDC::make_request_token_request($req, $resp);
Used to handle an incoming request token. It should be used in the following fashion:
my $req = new WebKDC::WebRequest;
my $resp = new WebKDC::WebResponse;
# if the user just submitted their username/password, include them
if ($username && $password) {
$req->user($username);
$req->pass($password);
}
# pass in any proxy-tokens we have from a cookies
# i.e., enumerate through all cookies that start with webauth_wpt
# and put them into a hash:
# $cookies = { "webauth_wpt_krb5" => $cookie_value }
$req->proxy_cookies($cookies);
# $req_token_str and $service_token_str would normally get
# passed in via query/post parameters
$req->request_token($req_token_str);
$req->service_token($service_token_str);
my ($status, $e) = WebKDC::make_request_token_request($req, $resp);
# for all these cases, check if $resp->proxy_cookies() has any
# proxy cookies we need to update when sending back a page to
# the browser
if ($status == WK_SUCCESS) {
# ok, request successful
} elsif ($status == WK_ERR_USER_AND_PASS_REQUIRED
|| $status == WK_LOGIN_FORCED) {
# prompt for user/pass
} elsif ($status == WK_ERR_LOGIN_FAILED) {
# supplied user/pass was invalid, try again
} else {
# use this if/elsif/else to pick the error message
if ($status == WK_ERR_UNRECOVERABLE_ERROR) {
# something nasty happened.
} elsif ($status == WK_ERR_REQUEST_TOKEN_STATLE) {
# user took too long to login, original request token is stale
} elsif ($status == WK_ERR_WEBAUTH_SERVER_ERROR) {
# like WK_ERR_UNRECOVERABLE_ERROR, but indicates the error
# most likely is due to the webauth server making the request,
} else {
# treat like WK_ERROR_UNRECOVERABLE ERROR
}
# display the error message and don't prompt anymore
}
AUTHOR
Roland Schemers (schemers@stanford.edu)
SEE ALSO
WebKDC::WebKDCException WebKDC::Token WebKDC::WebRequest WebKDC::WebRespsonse WebAuth.
perl v5.14.2 2012-04-25 WebKDC(3pm)