Sponsored Content
Full Discussion: Testing for exit status
Top Forums UNIX for Dummies Questions & Answers Testing for exit status Post 15658 by sskb on Monday 18th of February 2002 07:13:15 AM
Old 02-18-2002
Hi,
I am using CSH and trying to get a similar thing as follows.
I am not getting where I go wrong. could anyone please guide me?

#!/usr/bin/csh
set a = `grep "primary \# secondary" ar128.log`
if($a == 0) then
sed 's/primary \# secondary/secondary \#primary \#secondary/' ar128.log > ar128.log.ext
else
sed 's/secondary \#primary \#secondary/primary \# secondary/' ar128.log > ar128.log.ext
endif


i get no error even...

thanks
sskb
sskb
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

exit status

i downloaded a text file from metalab.unc.edu called sh.txt and in this reference manual it refers to shell scripting exit status .. at the end of one of the examples that author gave an exit status of 127.. to what does a 127 exit status refer too and what is its purpose in the code. moxxx68 (1 Reply)
Discussion started by: moxxx68
1 Replies

2. Shell Programming and Scripting

Problem with exit status

Hi, Consider the output of the following commands: case1) ------- # ifconfig -a | grep "UP" | grep uplink0:1 # echo $? Output is: 0 case2 ------ # ifconfig -a | grep "UP" | grep uplink0:1; echo $? Output is: 1 In case2 we got the exit code as 1, which is the actual exit code.... (1 Reply)
Discussion started by: diganta
1 Replies

3. Shell Programming and Scripting

Checking Exit Status

I hope one of you smart people out there can help me with what seems like a real simple questing but I can't quite figure out. In a script I am doing a cmp on two files. I am trying to check the exit status with an if statement but can't seem to figure out the syntax. If the exit status is 1 I... (4 Replies)
Discussion started by: PrimeRibAndADew
4 Replies

4. Shell Programming and Scripting

exit status for isql

I'm trying to write a script that will update a table in sysbase. If it's failed then I want to rerun it one more time before exiting the script (fail due to bad value such as trying to put a string into datetime field or bad connection to the database) Well my code below will always return... (2 Replies)
Discussion started by: sirrtuan
2 Replies

5. Shell Programming and Scripting

How to get the exit status

Hi all, I'm running a program which return 1 upon success. But when encounters problem shell return 's '1' . How to differentiate between them the shell return value and script return value. Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters... (1 Reply)
Discussion started by: yhacks
1 Replies

6. Shell Programming and Scripting

Exit status

I'm preparing for exam and one of exams is to write own test command... I wonder if in unix is a command which just returns exit code you specify.. I know I can easily write a function like this: exStatus() { return $1 } -> my question is rather theoretical thank you! (9 Replies)
Discussion started by: MartyIX
9 Replies

7. UNIX for Dummies Questions & Answers

$? = Exit status variable

hi, exit status variable $?, returns some digits. 0 ---> succes. 1..126 Failure (the program itself will decide what the numbers mean) 127 Command not found 128..254 The program did not exit normally. (E.g., it crashed, or received a signal) 255 Invalid exit code well, if $?... (4 Replies)
Discussion started by: dummydba
4 Replies

8. Shell Programming and Scripting

Exit status of grep

I am trying to get the exit status of grep and test a condition with it, But it does not seem to be working as expected since i am doing something wrong apparently as per grep help Exit status is 0 if match, 1 if no match, and 2 if trouble. My problem is something like this templine - a... (7 Replies)
Discussion started by: prasbala
7 Replies

9. Shell Programming and Scripting

Exit Status

I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be... (2 Replies)
Discussion started by: smkremer
2 Replies

10. Shell Programming and Scripting

Want to get the exit status

Hi All, I am trying to create a zip file with all the txt files(these are in large number) in the current directory. I am able to do this operation sucessfully. After this i want to get the status of the tar command executed and do accordingly. When i am trying with the below code, the status... (3 Replies)
Discussion started by: paddu
3 Replies
P10CFGD(1)						      General Commands Manual							P10CFGD(1)

NAME
p10cfgd - remote configuration daemom for Gracilis PackeTen SYNOPSIS
p10cfgd [IP_PORT] COPYRIGHT
Copyright (c) 1993 by Colorado Digital Eclectics (CODE) All rights reserved. DESCRIPTION
Rmtcfgd is a server program used to send configuration files to a Gracilis PackeTen. It can be run in background or it can be run by inetd. If p10cfgd is to be run by inetd, add the following line to /etc/services rmtcfg 1236/tcp # Remote Configuration of PackeTen and add the following to /etc/inetd.conf # Remote configuration service for PackeTen rmtcfg stream tcp nowait root /usr/bin/p10cfgd p10cfgd P10cfgd normally does not require the IP_PORT parameter. It listens for connections on IP Port 1236 as a default. The program will send on a line by line basis the file requested by the client that connects on the IP Port. The only expected input from the client is the file name. When the file has been sent, the connection is closed. The requested file must be in the directory /etc/p10cfgd. Rmtcfgd maintains a log of its activity in the file /var/log/p10cfgd.log. Program startup and all connections are logged in the file with GMT time stamps. The file is opened in append mode. The protocol used by the PackeTen is very simple. The PackeTen opens a tcp connection to port 1236 on a host system. Once the connection is made, the PackeTen sends the name of the file it wants to the host. The host then opens the file and sends it line by line to the Pack- eTen until all lines have been sent. The files to be transfered must be plain text files and each line must have at least one character in addition to the newline at the end. P10cfgd replaces all blank lines with lines that contain two spaces. If you wish to send a blank line, to stop loading of part of a LocalInfo file for example, place an underscore '_' at the begining of the line. The entire contents of the line will be deleted and a blank line will be sent to the client. At the end of the file, the server sends a time command ( time MMD- DYYHHMM ) with the UTC time on the server. This will either set the time on the PackeTen or add a time stamp to the LocalInfo file. The server then closes the connection. The remote configuration command used on the PackeTen is rmtcfg <server_host> <filename> [options] The valid options are -t <timeout in seconds> default is 60 sec -p <IP port #> default is 1236 -i the file is for LocalInfo -h <secondary server> if the primary does not answer The rmtcfg commands would be placed in to the EEPROM on the PackeTen so that they would be executed during a reboot. The information stored in the EEPROM should include enough information to set the PackeTen up to allow communications with the primary and the secondary server. This would include commands to set MYCALL and the IP_ADDRESS, to attach an interface to the channel with the server, routing information and so forth. A sample EEPROM configuration for a PackeTen, empire.wd0fhg.ampr.org [44.32.0.32], that gets its configuration from a remote system winfree.n3eua.ampr.org [44.32.0.2], over a 9600 baud ax25 path would be: # first the general setup of the PackeTen ee hostname gw.wd0fhg ee sitename empire ee ipaddr 44.32.0.32 ee mycall WD0FHG # Then we attach a 9600 ax25 interface as ax1 ee attach sync302 1 hdx ax25 ax1 8192 256 9600 ext ext nrzi # and set the default route to send every thing out ax1 ee route add default ax1 44.32.0.1 ee password sure-thing # # Now we will ask for the remainder of the setup # from the server winfree.n3eua.ampr.org [44.32.0.2] # Note that we have a secondary server available at # [44.20.0.195] that would be used if winfree is down. # first the Local Information file ee com 0 rmtcfg 44.32.0.2 empire.info -i -h 44.20.0.195 # and then the remaining configuration command file ee com 1 rmtcfg 44.32.0.2 empire.cfg -h 44.20.0.195 # ee save # end-of-eeprom setup Rmtcfgd started life as the simple server program in PERL by Larry Wall and R.L. Schwartz published by ORA,Inc. ENVIRONMENT
No environment variables are used. FILES
/etc/p10cfgd/* - files that can be accessed remotely /var/log/p10cfgd.log - p10cfgd log file AUTHOR
John Conner, WD0FHG, conner@empire.com hacked on by Bdale Garbee, N3EUA, bdale@gag.com. SEE ALSO
Gracilis, Inc. PackeTen Manual and NOS User's Manual DIAGNOSTICS
Complains if it can't open a file to remote client and to log file. 7th Edition July 29, 1993 P10CFGD(1)
All times are GMT -4. The time now is 04:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy