Sponsored Content
Full Discussion: command line argument - perl
Top Forums Shell Programming and Scripting command line argument - perl Post 302558733 by bshell_1214 on Sunday 25th of September 2011 05:36:25 AM
Old 09-25-2011
command line argument - perl

how do i check if a command line argument is -g?

for example,
Code:
if command line argument equals "-g"
{
  print "Goodbye \n";
}
else
{
  print "Welcome to the program! \n";
}


Last edited by Scott; 09-25-2011 at 06:43 AM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

command line argument parsing

how to parse the command line argument to look for '@' sign and the following with '.'. In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format. rmjoe123@hotmail.com has '@' sign and followed by a '.' to be more... (1 Reply)
Discussion started by: rmjoe
1 Replies

2. UNIX for Dummies Questions & Answers

array as command line argument !!!!

hello, can any help me how to can pass array as command line argument in korn shell. also how to read a array from command line. thanks spandu (2 Replies)
Discussion started by: spandu
2 Replies

3. Shell Programming and Scripting

How to get the value in last command line argument???

Say I want to get the value of last command line argument using the value in $# (or some other way if u can suggest) how do I do it?? $"$#" `$"$#"` These don't work :( (4 Replies)
Discussion started by: amit_oddey21
4 Replies

4. Shell Programming and Scripting

assign a command line argument and a unix command to awk variables

Hi , I have a piece of code ...wherein I need to assign the following ... 1) A command line argument to a variable e.g origCount=ARGV 2) A unix command to a variable e.g result=`wc -l testFile.txt` in my awk shell script When I do this : print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies

5. Programming

Command Line Argument

Hi, I have a very simple C program which will run in UNIX. When i am passing * as the command line argument, i am gettig the below output. Program: #include <stdio.h> #include "mylibrary.h" int **environ; int main(int argc,char *argv) { int i; printf("\nHello... (2 Replies)
Discussion started by: dsudipta
2 Replies

6. Shell Programming and Scripting

Comparison of command line argument in perl

Hello All, I have passed one command line argument in my script. I want to compare that value in the script itself. Is there any way to compare the command line variable....... (3 Replies)
Discussion started by: suvenduperl
3 Replies

7. Shell Programming and Scripting

command-line line 0: Missing yes/no argument

Hi Guys When I run the below command ssh -o 'PasswordAuthentication yes' -o 'PreferredAuthentications publickey' -i $HOME/.ssh/id_dsa Server_Name I found the below error ommand-line line 0: Missing yes/no argument Kindly help me to sort out Double post, continued... (0 Replies)
Discussion started by: Pratik4891
0 Replies

8. Shell Programming and Scripting

Specify an entire UNIX command as a command line argument

I'm trying to write a bash script called YN that looks like the following YN "Specify a question" "doThis" "doThat" where "doThis" will be executed if the answer is "y", otherwise "doThat". For example YN "Do you want to list the file dog?" "ls -al dog" "" Here's my attempt... (3 Replies)
Discussion started by: LeoKSimon
3 Replies

9. UNIX for Beginners Questions & Answers

Command line argument

Hi Guys, I'm trying to work out how to add a command line argument inside single quotes. Would anyone be able to help please as I'm going mad :) I want to be able to place the filename on command line and it then be used in a script but it needs to have quotes surrounding it. Thanks in... (4 Replies)
Discussion started by: mutley2202
4 Replies

10. Shell Programming and Scripting

Add command line argument

I would like to add the ability to change the message that is displayed when timer is finished. At present it just asks for the time I want for the alarm. I think what I need is another command line argument. soundfile="/usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3"... (5 Replies)
Discussion started by: drew77
5 Replies
DBATBL(1)						      General Commands Manual							 DBATBL(1)

NAME
dbatbl - Manage on-disk reference tables for DB-ALLe SYNOPSIS
dbatbl [command] [options] [args...] DESCRIPTION
This tool allows to index and query the tables that are needed for normal functioning of DB-ALLe. dbatbl always requires a non-switch argument, that indicates what is the operation that should be performed: help Print a help summary. help manpage Print this manpage. cat tableid [tableid [...]] Output all the contents of a WMO B table.. grep string Output all the contents of the local B table whose description contains the given string.. expand table-entry [table-entry [...]] Describe a WMO B table entry or expand a WMO D table entry in its components.. expandcode varcode [varcode [...]] Expand the value of a packed variable code. index [options] filename index-id Index the contents of a table file. describe [options] what [values] Invoke the formatter to describe the given values. Supported so far are: "level ltype l1 l2", "trange pind p1 p2". OPTIONS
dbatbl follows the usual GNU command line syntax, with long options starting with two dashes (`-'). Option for command cat -?, --help print an help message -c, --csv output variables in CSV format Option for command grep -?, --help print an help message -c, --csv output variables in CSV format Option for command expand -?, --help print an help message Option for command expandcode -?, --help print an help message Option for command index -?, --help print an help message -t type, --type=type format of the table to index ('b', 'd', 'conv') Option for command describe -?, --help print an help message AUTHOR
dbatbl has been written by Enrico Zini <enrico@enricozini.com> for ARPA Emilia Romagna, Servizio Idrometeorologico. may 16, 2012 DBATBL(1)
All times are GMT -4. The time now is 04:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy