Sponsored Content
Full Discussion: Simple shell script function
Top Forums UNIX for Beginners Questions & Answers Simple shell script function Post 303031411 by nezabudka on Thursday 28th of February 2019 02:08:41 AM
Old 02-28-2019
Code:
if [ $? -ne 0 ]; then
    :
else
    echo "FAIL"
    return
fi
echo "OK:PASSED"

Only I don't understand a little why not 0 is not an error? And there is no operator "done"

--- Post updated at 10:08 ---

Code:
vgcheck() {
        lsvg -o | 
                while read vg; do
                        lsvg -p $vg | grep Missing
                        if [ $? -ne 0 ]; then
                                :   
                        else
                                echo "FAIL"
                                return #if you need exit
                        fi  
                done
        echo "OK:PASSED"
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need a simple shell script

Hi, I am new to unix as well as shell programming. Any body can provide me a simple shell script which should copy/transfer/fetch a file(using FTP)from remote server to local system.and it should log the details when it was fetched.If there is any error,the error msg should log in log... (1 Reply)
Discussion started by: Mar1006
1 Replies

2. Shell Programming and Scripting

Simple Shell Script Need Help

I M TRYING TO DO SUM THING I M A NEW LEARNER TO SHELL SCRIPT PLZZZ HELP ME FRIENDS I M TRY TO DO SUM THING C IT AND HELP ME First open a .ctl file Copy the file into temp file Add A EXTRA FIELD “ext_date” with keeping value “##**&&” EG- EXT_DATE CONSTANT"******" Each time... (2 Replies)
Discussion started by: kulbir
2 Replies

3. Shell Programming and Scripting

simple shell - how to get a parameter typed in a shell script

Hi, I am new to unix and using linux 7.2. I would like to create a script that would make it easyer for me to run my java programms. At the moment I have to type java myJavaprogram I am trying to write a script that will allow me to type something like this "myscript myJavaprogram" or maybe... (4 Replies)
Discussion started by: cmitulescu
4 Replies

4. Shell Programming and Scripting

Simple Shell Script using function

Hi all, I am new to shell scripting.I have made a simple shell script which will give me number of records in a database table. The SQL statement is working fine and there are 11 rows in this table. But problem is that it is not printing this value and fucntion does not get called. Please see the... (5 Replies)
Discussion started by: 33junaid
5 Replies

5. Shell Programming and Scripting

SHELL SCRIPT Function Calling Another Function Please Help...

This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord but only one record is getting wrote in DB.... Please advise ASAP...:confused: function InsertFtg { FTGSTR="" echo "Saurabh is GREAT $#" let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies

6. Shell Programming and Scripting

Simple Shell Script

Hello Friends, I am writing a shell script which will grab a file if it exists and copies it to another folder and will append with current date. I have written but gives me error, plz help: -------------------------------------------- #!/usr/bin/sh source=/home/dev4rice/naveen/test1... (4 Replies)
Discussion started by: ganesh123
4 Replies

7. Shell Programming and Scripting

Help me with simple shell script.

Hello forum members, I have to redirect a output of command into a text file inside a script file but iam getting an errors.so please see below script and suggest me for corrections. #!/bin/ksh read IP_ADD echo nslookup $IP_ADD 2>&1| tee log1.txt cat /amex/gcst/siva/Testr/log1.txt... (6 Replies)
Discussion started by: rajkumar_g
6 Replies

8. Shell Programming and Scripting

Help with simple Shell Script

Hi , I am in need of simple shell script that has one input file containing some words Input file 1 : ****ALEX***JOHN*******VIRGIL***** CHRITINE*****FAISAL*****DON***** ****ALEX***JOHN*******VIRGIL***** CHRITINE*****FAISAL*****DON***** ****ALEX***JOHN*******VIRGIL*****... (6 Replies)
Discussion started by: kmanjuna
6 Replies

9. Shell Programming and Scripting

Help on simple shell script

Hello, I am running openmediavault on my Raspberry and I would like to use it as a backup FTP server of snapshots taken from my IP cams. So I get the network recorder to upload every 3 seconds a snapshot to the Raspberry. Everything works perfectly. I would need now a simple script that... (5 Replies)
Discussion started by: dcaccount
5 Replies

10. Shell Programming and Scripting

Help on simple shell script

Hello, I need to create one very simple shell script that checks if the first character of the file ./pump.txt is 0 and in that case gives a message. If the first character is instead 1, it does give a different message. I have written: irr= head -c 1 ./pump.txt if ]; then echo... (4 Replies)
Discussion started by: dcaccount
4 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 06:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy