Sponsored Content
Top Forums Shell Programming and Scripting Doing a command in the if statement Post 302542832 by vas28r13 on Thursday 28th of July 2011 05:49:03 PM
Old 07-28-2011
Doing a command in the if statement

Im using MKS Toolkit c shell

I want to check if a command will nit return a certain message. If so....blah blah blah.

Code:
 if ( `command argument` != "ERROR!" ) then

that did not work for me

does anyone have any idea of how to do this??

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk command for INSERT statement

Hi, I sometimes bulk upload data in oracle. The problem is that I sometimes get an INSERT statemnt like this: INSERT INTO ALL_USER_HOTSPOT_DETAILS (USR_LOGIN,USR_LASTNAME,USR_FIRSTNAME,USR_EMAIL, PROPERTYNR) VALUES ('SABRDAG','D'AGOS','SABRINA','sabrina_d'agos@sheraton.com',70) I... (4 Replies)
Discussion started by: nattynatty
4 Replies

2. Shell Programming and Scripting

grepping the output of a command in an if statement

Probably a really simple question but how do check/grep against the output of a command within an if statement ?? for example if then do this else do something else fi (3 Replies)
Discussion started by: hcclnoodles
3 Replies

3. Shell Programming and Scripting

How to convert unix command into Awk statement

Hi all, How can i use the below unix command in AWK . Can any one please suggest me how i can use. sed -e "s/which first.sh/which \$0/g" $shell > $shell.sal where $0=current program name(say current.sh) $shell=second.sh (1 Reply)
Discussion started by: krishna_gnv
1 Replies

4. UNIX for Dummies Questions & Answers

Case statement/sed command

The file dbnames.txt has 5 columns, what i'm trying to do is that when the fifth column equals A, store in the variable "access" the word, "admin access". If it equals B, then "business access" etc. I think their is a problem with my sed command, because it is not substibstituting the words... (1 Reply)
Discussion started by: ross_one
1 Replies

5. Shell Programming and Scripting

running if statement on command line

Hi, is it possible to run an if statement from the command line? I am doing this # service postgresql status; if ] ; then awk '{print ""$2""}' /root/file.txt > But it throws me into a different mode ie the > then I have to do a ctrl+c. I want to do it this way because I will be... (2 Replies)
Discussion started by: borderblaster
2 Replies

6. Shell Programming and Scripting

Problem in using ftp command under if statement

If i use ftp command under if statement it shows the error "Syntax error at line 19 : `<<' is not matched." But if i use ftp command outside if statement, then it is running fine. Can anyone please help me in this. Code: #!/bin/sh echo "\nPress 1 for automated file dumping." echo... (9 Replies)
Discussion started by: makauser
9 Replies

7. Shell Programming and Scripting

Command in inside awk statement

Hello can you please help me with below script which is meant to delete clients from multiple netbackup policies I want to run a command insdie awk statement apparelnlty this script is not working for me for i in $( cat clients_list) do bppllist -byclient $i | awk... (6 Replies)
Discussion started by: Sara_84
6 Replies

8. Shell Programming and Scripting

SQLPLUS command with more than 1 select statement

Hi all, I'm using below code processId=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS whenever sqlerror exit sql.sqlcode; set head off feedback off echo off pages 0 SELECT PROCESS_ID FROM LSHADMIN.DATA_DOMAIN WHERE DOMAIN_NAME = '${tabname}' ... (8 Replies)
Discussion started by: Pratiksha Mehra
8 Replies

9. Shell Programming and Scripting

How to add printf statement in awk command?

hi all i need to add the prinf statement in awk command for the converted comma separated output.... below is my code : Code Credits :RudiC awk -F, 'NF==2 {next} {ITM=$1 AMT=$2+0 CNT=$3+0 TOTA+=$2 ... (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies

10. UNIX for Beginners Questions & Answers

Using df -g command with awk to get SQL statement

Hi Gurus... good day; currently I trying to run the df -g command with awk to get to convert in SQL statement, but I have some errors; df -g | awk '{print "This is the FileSystem: " $NF, " This is LV: "$1, "This is SIZE: "$2, "This is FREE: " $3, "This is the USED% "$4}' This on AIX... (3 Replies)
Discussion started by: wcastibl
3 Replies
Time::Duration::Parse(3pm)				User Contributed Perl Documentation				Time::Duration::Parse(3pm)

NAME
Time::Duration::Parse - Parse string that represents time duration SYNOPSIS
use Time::Duration::Parse; my $seconds = parse_duration("2 minutes and 3 seconds"); # 123 DESCRIPTION
Time::Duration::Parse is a module to parse human readable duration strings like 2 minutes and 3 seconds to seconds. It does the opposite of duration_exact function in Time::Duration and is roundtrip safe. So, the following is always true. use Time::Duration::Parse; use Time::Duration; my $seconds = int rand 100000; is( parse_duration(duration_exact($seconds)), $seconds ); FUNCTIONS
parse_duration $seconds = parse_duration($string); Parses duration string and returns seconds. When it encounters an error in a given string, it dies an exception saying "Unknown timespec: blah blah blah". This function is exported by default. AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net> COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Some internal code is taken from Cache and Cache::Cache modules on CPAN. SEE ALSO
Date::Manip, DateTime::Format::Duration, <http://use.perl.org/~miyagawa/journal/30310> perl v5.10.0 2008-06-02 Time::Duration::Parse(3pm)
All times are GMT -4. The time now is 08:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy