Sponsored Content
Full Discussion: Simple If then statement
Top Forums UNIX for Dummies Questions & Answers Simple If then statement Post 302436027 by dr.house on Friday 9th of July 2010 04:10:48 AM
Old 07-09-2010
Quote:
Originally Posted by Dallasbr
What value would the variable have upon a empty result?
One answer: the return string would be of length zero ...

Code:
if [ -z "$CheckFile" ]; then
   echo $CheckFile
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

What's wrong with this simple statement?

I know that this is a ridiculously simple statement, but I am getting an error when I execute it, and I can't figure out what it is. Can anyone point me in the right direction? #!/bin/ksh integer dateMonth=0 integer intZero=0 if then dateMonth = 1 fi echo $dateMonth (7 Replies)
Discussion started by: mharley
7 Replies

2. Shell Programming and Scripting

sh -help with case statement (should be simple)

I'm having an issue running multiple commands in a case statement. If i only run one command it works fine. Am I supposed to use double semi-colons after each statement or do i not need any at all? here is a snippet of the code: case `uname` in "Linux") echo This is linux. cat... (1 Reply)
Discussion started by: kuliksco
1 Replies

3. Shell Programming and Scripting

Using simple if statement in script

Hello, I am trying to create a simple script that will check the disk usage of a drive, and if it is over the limit it will delete the oldest ten files. everything is working except for when i implement the if statement i get the error /usb0: zero divisor. I am pretty sure that the du -k... (1 Reply)
Discussion started by: bpage
1 Replies

4. Shell Programming and Scripting

Simple if statement

Hi there, Im new in the scripting world and ran into trouble yesterday. I want to make a small script that runs in crontab checking folders. If the folder size is greater than 10 (or what I set the variable to) then send a mail with a warning. #!/bin/sh set -x A=8 C=`du -skh... (7 Replies)
Discussion started by: ntenz
7 Replies

5. Shell Programming and Scripting

simple if and then statement

guys, in one of my script, I want to include and a if and then statement which basically does the the following: if a file (constant location and filename) is greater in size than 0 bytes, then it should send out an email. I have tried the following so far with no luck: 1) if # is... (1 Reply)
Discussion started by: admininmaking
1 Replies

6. Shell Programming and Scripting

Help with simple for statement please

Hi guys, I'm typing the following command, but I'm getting a different output than expected. for file in *20* do ls -l $file | wc -l done Instead of listing a total count of the files, it seems to be counting each file and then printing the number of the file - which is 1. How... (7 Replies)
Discussion started by: bbbngowc
7 Replies

7. Shell Programming and Scripting

Simple if statement help needed please

if ]; then echo "successssssssssssssssssss" $filename = "<font color='red'>$i</font>" else echo "failureeeeeeeeeeeeeeeeeeeee" $filename = "$i" fi; I'm just trying to see is this - read a file name and highlight... (2 Replies)
Discussion started by: vmanda
2 Replies

8. Shell Programming and Scripting

Need help with failing simple if statement

So I'm writing a script that takes in arguments given from the shell. The last argument I'm using as a tag to tell my script, via if statements, to do one thing or another. A sample input would be: script.scr infile.txt outfile.txt F The "F" at the end there I expect to be one of two tags... (3 Replies)
Discussion started by: Malavin
3 Replies

9. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies

10. Shell Programming and Scripting

How would I construct a (possibly simple) IF statement?

Hi all, I thought this would be simple, but I've been having a lot of trouble trying to write this IF statement, if I may ask for help pls: In BASH, how would I construct the if statement: Should ONLY be true if USEROPTscript=="yes"]] AND $mode=="INSTALL" /or/ $mode=="CHANGE" ]]... (3 Replies)
Discussion started by: jmccoughlin
3 Replies
Locale::Codes::LangExt(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangExt(3pm)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangExt(3pm)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy