Sponsored Content
Top Forums UNIX for Dummies Questions & Answers If Else Statement, Goodnight/bye Post 302603877 by methyl on Friday 2nd of March 2012 08:15:47 AM
Old 03-02-2012
You were trying to read a file called "16" from an inward redirect "<". You also had mismatched brackets in your "if" statement.

Try a numeric compare:

Code:
#!/bin/bash
TIMED=$(date +%H)

if [ ${TIMED} -lt 16 ]; then
     echo Have a great day $USER
else
     echo Have a great night $USER
fi

This User Gave Thanks to methyl For This Post:
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if statement

can someone please tell me what is wrong with the below. i'm trying to get a script to run if the content of a variable is either small letter y or capital letter Y. if then whatever fi (4 Replies)
Discussion started by: Terrible
4 Replies

2. Programming

Zero bye file not deleting

Hi All... The code i have written is if(filename) remove_files (filename); and my remove function is ========================================= void remove_files(char *rf) { if (remove(rf)==0) printf("(%d) Deleting %s\n",getpid(), rf); // JC 10/24/2003 ... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

3. Shell Programming and Scripting

If statement - How to write a null statement

In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands. How do I write the "do nothing" statement in the following example? Example: if (( "$x"="1" && "$y"="a" && "$z"="happy" )) then do nothing else command command fi... (3 Replies)
Discussion started by: april
3 Replies

4. Shell Programming and Scripting

How is use sselect statement o/p in insert statement.

Hi All, I am using Unix ksh script. I need to insert values to a table using the o/p from a slelect statement. Can anybody Help! My script looks like tihs. ---`sqlplus -s username/password@SID << EOF set heading off set feedback off set pages 0 insert into ${TB_NAME}_D... (2 Replies)
Discussion started by: nkosaraju
2 Replies

5. Shell Programming and Scripting

Difference between exit, bye and quit in sftp

Hi All, I would like to know whether is there any difference in closing the sftp connection with exit, bye and quit. And would like to know the reliable command. (3 Replies)
Discussion started by: Girish19
3 Replies

6. 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
PPI::Statement::End(3)					User Contributed Perl Documentation				    PPI::Statement::End(3)

NAME
PPI::Statement::End - Content after the __END__ of a module SYNOPSIS
# This is normal content __END__ This is part of an PPI::Statement::End statement =pod This is not part of the ::End statement, it's POD =cut This is another PPI::Statement::End statement INHERITANCE
PPI::Statement::End isa PPI::Statement isa PPI::Node isa PPI::Element DESCRIPTION
"PPI::Statement::End" is a utility class designed to serve as a contained for all of the content after the __END__ tag in a file. It doesn't cover the ENTIRE of the __END__ section, and can be interspersed with PPI::Token::Pod tokens. METHODS
"PPI::Statement::End" has no additional methods beyond the default ones provided by PPI::Statement, PPI::Node and PPI::Element. SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.18.2 2011-02-25 PPI::Statement::End(3)
All times are GMT -4. The time now is 02:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy