Hi,
I'm trying to write a shell script that has a menu and then dependant on the selection, will automate some samba file transfer.
The problem is when I run the code without the case statement it runs fine. but when I put the case statement in the only way I can get the code to run is to... (6 Replies)
Hi All,
this small script is written to recognize user input character.. it is in small case .. upeer case or is a number... but when i input first capital letter say A.. it always gives small character.... what is the problem.
#!/bin/bash
echo "Enter the character"
read a
case $a in
)... (2 Replies)
In a case statement like below :
case $rental in
"car") echo "For $rental Rs.20 per k/m";;
"van") echo "For $rental Rs.10 per k/m";;
"jeep") echo "For $rental Rs.5 per k/m";;
"bicycle") echo "For $rental 20 paisa per k/m";;
*) echo "Sorry, I can not gat a $rental for you";;... (4 Replies)
Hi,
I have a script like below :
#!/bin/ksh
echo "Do you want to export all docs ?"
read alld
echo "Do you want to export template or report only "
read temr
case && ]
#arguments
;;
case && ]
#arguments
;;
case && ]
#arguments
;; (4 Replies)
I'm in the process of writng a function that consists of a case statement is there a way of calling the function and passing a value to it?
ie
function1 () {
case
opt1 do .....
opt2 do.....
esac
}
function opt1
I'm aware the syntax is not correct, but you get the general idea. (1 Reply)
hi all
i am trying to get help with writing a script using case statement to display menu as
1) Authentication log
2) System log
3) Messages
4) Dmesg
5) Boot log
Q) Exit
When selecting the menu by 1 or 2 or 3 o 4 or 5, it should display the last 10 lines of the log files,
if... (3 Replies)
have written the below code to check whether the string received from user is a file name or dir using case statement, but its going into default case*).
#!/bin/sh
#Get a string from user and check whether its a existing filename or not
rm str2
rm str3
echo "enter a file \c"
read fil... (8 Replies)
Hi Gurus,
I have a very weird requirement and have no clue to resolve the issue. please help me get out this difficulty
below two tables, table1 contains the column name. D means this column used for the rule. for example: rule 0 is all columns have value, rule1 is col3 and col7 have no value.... (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
This is what is asked:
If the user enters ‘3’, prompt the user for two file names. Verify that the file names... (2 Replies)
Discussion started by: cindy01
2 Replies
LEARN ABOUT DEBIAN
env::sanctify
Env::Sanctify(3pm) User Contributed Perl Documentation Env::Sanctify(3pm)NAME
Env::Sanctify - Lexically scoped sanctification of %ENV
VERSION
version 1.06
SYNOPSIS
my $sanctify = Env::Sanctify->sanctify( sanctify => [ '^POE' ] );
# do some stuff, fork some processes etc.
$sanctify->restore
{
my $sanctify = Env::Sanctify->sanctify( env => { POE_TRACE_DEFAULT => 1 } );
# do some stuff, fork some processes etc.
}
# out of scope, %ENV is back to normal
DESCRIPTION
Env::Sanctify is a module that provides lexically scoped manipulation and sanctification of %ENV.
You can specify that it alter or add additional environment variables or remove existing ones according to a list of matching regexen.
You can then either "restore" the environment back manually or let the object fall out of scope, which automagically restores.
Useful for manipulating the environment that forked processes and sub-processes will inherit.
CONSTRUCTOR
"sanctify"
Creates an Env::Sanctify object. Takes two optional arguments:
'env', a hashref of env vars to add to %ENV;
'sanctify', an arrayref of regex pattern strings to match against current %ENV vars;
Any %ENV var that matches a "sanctify" regex is removed from the resultant %ENV.
METHODs
"restore"
Explicitly restore the previous %ENV. This is called automagically when the object is "DESTROY"ed, for instance, when it goes out of
scope.
AUTHOR
Chris Williams <chris@bingosnet.co.uk>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Chris Williams.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-03-14 Env::Sanctify(3pm)