taskes one or more .l files and compiles them
#!/usr/bin/csh
#while loop to carry on asking user to enter the files
while $number!=0
echo "enter file name"
#check to see if file ends with .l
#if file ends with .l compile lexx.yy.c file for each file
this is how i think it needs... (1 Reply)
Experts,
I tried to make my cshell script interactive by asking the user for password and trying to read the input using the "read" command. I have been unsuccessful so far. Do you have any idea ?
Thanks
Jim (2 Replies)
Hi Everyone,
I'm facing a problem using grep in Cshell.
This is what i'm trying to do:
grep "abc" somefile
VAR="$?"
echo $VAR
somefile contains:
abc
def
ghi
Now, should'nt my output be 0 (Zero)
I'm getting 1 (One)
Can you please help me out.
Thanks in advance :)
G1 (2 Replies)
Hello...
I am new to unix and I am wondering if in a C-shell script , Are we supposed to use only whole numbers........ for example..if a program needs to calculate the average of some numbers........
@ avg = (($1 +$2 + $3)/3)) is returning a whole number.........How can a decimal be achieved... (1 Reply)
Hi guys,
Basically I'm trying to write a CShell script that calls an awk script on a given directory (given in command-line). I keep getting a syntax error with my code though:
#!/bin/csh
set dir = $ARGV
foreach file ( $dir/* )
set output = 'awk -f /Desktop/aal $file'
echo... (3 Replies)
If I want to compare two string variables in csh how do I correctly implement it. For example I'm checking if on cmdln the $1 == -r do something.
if($1 == -r) then
code....
However when I run it I just get an error message "if: Missing file name".
Any suggestions? (1 Reply)
Hello everyone! i'm new in this forum and I'm here because I have a huge problem with a csh script. Here the problem: I have to write a script that check the system status, more precisely I have to check if there are processes with TIME > 3 hours and if such processes exists I must send a mail... (3 Replies)
Hi I am trying to put the following commands that i have to type manually at the cshell prompt into a cshell script startup.csh which is copied below
echo $DISPLAY
xhost +
rsh ba08lo01
module load incisiv/102/10.20.035
setenv DISPLAY $DISPLAY
When i run the script with source command... (2 Replies)
Hi,
I am unable to call one script from another script in c shell on windows SUA environment.
Please find below code ,
File1 āTmp.csh:
#!/bin/csh
setenv PATH "${PATH}:.:$TOP/bin:$TOP/RMBIN/bin:$GP_SUA/:$INTERIX_ROOT"
echo "hi1"
. /tmp1.csh
File2ātmp1.csh
... (6 Replies)
Hello Guys,
I would like to ask you for a favor. Could you please help me how can I assign any number as the parameter to a, from stdin (-c), in the following command line by using the 'switch' in a script?
awk '$8>a {print "File name:" $5,$8}'
I would also appreciate if you can share any... (1 Reply)
Discussion started by: Padavan
1 Replies
LEARN ABOUT DEBIAN
plack::response
Plack::Response(3pm) User Contributed Perl Documentation Plack::Response(3pm)NAME
Plack::Response - Portable HTTP Response object for PSGI response
SYNOPSIS
use Plack::Response;
sub psgi_handler {
my $env = shift;
my $res = Plack::Response->new(200);
$res->content_type('text/html');
$res->body("Hello World");
return $res->finalize;
}
DESCRIPTION
Plack::Response allows you a way to create PSGI response array ref through a simple API.
METHODS
new
$res = Plack::Response->new;
$res = Plack::Response->new($status);
$res = Plack::Response->new($status, $headers);
$res = Plack::Response->new($status, $headers, $body);
Creates a new Plack::Response object.
status
$res->status(200);
$status = $res->status;
Sets and gets HTTP status code. "code" is an alias.
headers
$headers = $res->headers;
$res->headers([ 'Content-Type' => 'text/html' ]);
$res->headers({ 'Content-Type' => 'text/html' });
$res->headers( HTTP::Headers->new );
Sets and gets HTTP headers of the response. Setter can take either an array ref, a hash ref or HTTP::Headers object containing a list
of headers.
body
$res->body($body_str);
$res->body([ "Hello", "World" ]);
$res->body($io);
Gets and sets HTTP response body. Setter can take either a string, an array ref, or an IO::Handle-like object. "content" is an alias.
Note that this method doesn't automatically set Content-Length for the response. You have to set it manually if you want, with the
"content_length" method (see below).
header
$res->header('X-Foo' => 'bar');
my $val = $res->header('X-Foo');
Shortcut for "$res->headers->header".
content_type, content_length, content_encoding
$res->content_type('text/plain');
$res->content_length(123);
$res->content_encoding('gzip');
Shortcut for the equivalent get/set methods in "$res->headers".
redirect
$res->redirect($url);
$res->redirect($url, 301);
Sets redirect URL with an optional status code, which defaults to 302.
Note that this method doesn't normalize the given URI string. Users of this module have to be responsible about properly encoding URI
paths and parameters.
location
Gets and sets "Location" header.
Note that this method doesn't normalize the given URI string in the setter. See above in "redirect" for details.
cookies
$res->cookies->{foo} = 123;
$res->cookies->{foo} = { value => '123' };
Returns a hash reference containing cookies to be set in the response. The keys of the hash are the cookies' names, and their
corresponding values are a plain string (for "value" with everything else defaults) or a hash reference that can contain keys such as
"value", "domain", "expires", "path", "httponly", "secure".
"expires" can take a string or an integer (as an epoch time) and does not convert string formats such as "+3M".
$res->cookies->{foo} = {
value => 'test',
path => "/",
domain => '.example.com',
expires => time + 24 * 60 * 60,
};
finalize
$res->finalize;
Returns the status code, headers, and body of this response as a PSGI response array reference.
AUTHOR
Tokuhiro Matsuno
Tatsuhiko Miyagawa
SEE ALSO
Plack::Request
perl v5.14.2 2012-06-21 Plack::Response(3pm)