Sponsored Content
Top Forums Shell Programming and Scripting How to check parameter variable? Post 74606 by negixx on Friday 10th of June 2005 04:29:41 PM
Old 06-10-2005
How to check parameter variable?

Hello All,

I have a script that will email out if the email address is specified as parameter 1.

I am using ksh, and then tried the following :

email=$1

Following did not work, I am getting error
test -z $email
test ${email:=" ") -eq " "
test -n $email
test ${?email}

What I am trying to do is, if $1 has a value, then email the report to that email address...

i.e. getreport.ksh test@gmail.com - will generate report and then email out.
getreport.ksh - will just generate the report


Thanks!

Joseph
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with making a parameter check script.

I am making a script to check the parameters, but it seems that I can't catch the parameters by loop. $ cat sendmsg.sh #!/bin/sh ## Parameter Check i=0 max=$# while do PARAM=$${i} i=`expr ${i} + 1` echo ${PARAM} done How can I get the $1, $2, $3 by loop and set their... (2 Replies)
Discussion started by: GCTEII
2 Replies

2. Shell Programming and Scripting

Check if parameter passes in contains certain string

Hi Guys, I am writing a Unix script which accepts a directory path as parameter $1 so something like /user5.data/WA/01 will be passed in. I want to determine if the directory path passed in contains "WA" as above (because then I need to do something specific if it does) What is the... (9 Replies)
Discussion started by: bcunney
9 Replies

3. Shell Programming and Scripting

Reading a variable from parameter file

HI all, I have a parameter file with entries like $$Name =Abhinav $$CUTOFF_DATE = 11/11/2209 I am reading a variable from this file using a awk command like : var2=`awk -F"" "/CUTOFF_DATE/{f=$1;}{print f;}" InputFIleName` but facing an error like awk: cmd. line:1:... (3 Replies)
Discussion started by: abhinav192
3 Replies

4. UNIX for Advanced & Expert Users

How to check what are the current kernel parameter settings

Hi all, I have four (4) different UNIX flavours and I want to know whether the following commands are correct with respect to wanting to check on what are my current kernel parameter settings. I just want to clear the doubts hanging over my head whether the commands below are the right ones... (2 Replies)
Discussion started by: newbie_01
2 Replies

5. Shell Programming and Scripting

Check input parameter

Hi all i need to check that if user has passed any input parameter while executing he shell script like ./test1.sh -a"-v" then do smothing if user execute the script without giving input paramater then ./test1.sh then do something how can we check this input parameter (6 Replies)
Discussion started by: aishsimplesweet
6 Replies

6. Shell Programming and Scripting

How to pass a function with a variable parameter into another variable?

Hello again :) Am currently trying to write a function which will delete a record from a file. The code currently looks as such: function deleteRecord() { clear read -p "Please enter the ID of the record you wish to remove: " strID ... (2 Replies)
Discussion started by: U_C_Dispatj
2 Replies

7. Shell Programming and Scripting

Check parameter is number or string

Hey I'm new in linux, I'm looking for a code to check whether the parameter is a number or a string. I have already tried this code: eerste=$(echo $1 | grep "^*$">aux) if But it doesn't work.:confused: Thanks (2 Replies)
Discussion started by: Eclecticaa
2 Replies

8. Shell Programming and Scripting

variable parameter assigning prblms

Hi, In my script, there is a variable as below TME=`date +%H` I want to take this TME value into another variable called TME_PAR which i can use outside of the current script and this TME_PAR is already present in my home_dir and i wrote below line of code $home_dir/$TME_PAR=`echo... (1 Reply)
Discussion started by: JSKOBS
1 Replies

9. Shell Programming and Scripting

Duplicate check by passing external parameter

I have a code which is using to find duplicates in a files based on column.Below is the same code which is used to find duplicates in my file based on column 1 awk -F'|' '{if (x) { x_count++; print $0; if (x_count == 1) { print x } } x = $0}' FileName >Dup_File.txt But my requirement here is... (3 Replies)
Discussion started by: ginrkf
3 Replies

10. Shell Programming and Scripting

Identify the Parameter variable file

Hi I am trying to understand a shell scipt file ( .ksh file ) . In the shell script we are referring a variable . Example : SessLogs=$STAFF_MSTR_DIR/staff_dtls There are no references in the shell script from where the variable "$STAFF_MSTR_DIR" is being read from . Could anyone... (2 Replies)
Discussion started by: Sudheer Maddula
2 Replies
Jifty::Plugin::User::Mixin::Model::User(3pm)		User Contributed Perl Documentation	      Jifty::Plugin::User::Mixin::Model::User(3pm)

NAME
Jifty::Plugin::User::Mixin::Model::User - user model base mixin SYNOPSIS
package MyApp::Model::User; use Jifty::DBI::Schema; use MyApp::Record schema { # column definitions }; # Import columns: name, email and email_confirmed use Jifty::Plugin::User::Mixin::Model::User; DESCRIPTION
This mixin may be added to a model to give your user accounts a name and an email address. This module may be used as the basic building block for building account models in your application. It can be combined with mixins from an authentication plugin to create an object suitable for a given authentication mechanism. SCHEMA
This mixin model adds the following columns to the model. name This is the username/nickname for the user of the account. email This is the email address of the account. It is intended as a bare minimum confirmation of identity and for communication of password resets and other account information. email_confirmed This is a flag indicating whether the user has confirmed ownership of the given email address. METHODS
set_email ADDRESS Whenever a user's email is set to a new value, we need to make sure they reconfirm it. validate_email Makes sure that the email address looks like an email address and is not taken. SEE ALSO
Jifty::Plugin::Authentication::Password, Jifty::Plugin::Authentication::Password::Mixin::Model::User LICENSE
Jifty is Copyright 2005-2010 Best Practical Solutions, LLC. Jifty is distributed under the same terms as Perl itself. perl v5.14.2 2010-12-10 Jifty::Plugin::User::Mixin::Model::User(3pm)
All times are GMT -4. The time now is 09:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy