Sponsored Content
Full Discussion: Confirming command
Operating Systems AIX Confirming command Post 302496384 by Ygor on Monday 14th of February 2011 01:11:25 AM
Old 02-14-2011
Create a function in your script, e.g...
Code:
function sure {
    echo Confirm Command: $*
    unset REPLY
    until [[ $REPLY = "Y" ]] || [[ $REPLY = "N" ]]
    do
        printf 'Are you sure? [Y/N]: '
        read
    done
    if [[ $REPLY = "Y" ]]
    then
        echo Executing Command: $*
        $*
    fi
}

...and use it like this...
Code:
sure stopsrc -s qdaemon
sure stopsrc ...

 

10 More Discussions You Might Find Interesting

1. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

2. Shell Programming and Scripting

Confirming Syntax - IF statement.

Hi All, Has been a while since I was last on, so I hope everyone has been doing fine. ;) Would like to know if the below IF statement syntax is correct for a ksh environment. It's been pushed into live as someone had deleted the development copy(!); not withstanding that, the statement now... (3 Replies)
Discussion started by: Cameron
3 Replies

3. Shell Programming and Scripting

Confirming Remote Copy

Hey guys. I'm knocking up a script, a part of which will be copying some pretty large files to some remote servers. With the size of the files I need to make sure that they don't lose any data / corrupt on the way (it's unlikely, but these are business critical). Obviously I could use the... (2 Replies)
Discussion started by: dlam
2 Replies

4. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

5. IP Networking

Confirming Successful Server/Device Reboot

Hello I've created a list with IP address to servers/devices I would like to reboot and have logged the following to the /tmp before: -netstat -nrv -/etc/rc2.d/netmask -/etc/rc2.d/defaultrouter -ifconfig -a I would like to confirm that nothing changed after the reboot. I know this can be... (0 Replies)
Discussion started by: ravzter
0 Replies

6. UNIX for Dummies Questions & Answers

passing command output from one command to the next command in cshell

HI Guys, I hope you are well. I am trying to write a script that gets executed every time i open a shell (cshell). I have two questions about that 1) I need to enter these commands $ echo $DISPLAY $ setenv $DISPLAY output_of_echo_$display_command How can i write a... (2 Replies)
Discussion started by: kaaliakahn
2 Replies

7. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

8. Shell Programming and Scripting

Confirming a string

Hi Guys, I have files that are sent to me in this format: Copy of USer Database updated 23 JANUARY 2013.csv I am developing a script to load these files to my database automatically whenever I get these files: How do I verify these files in an if statement if I do have these files? ... (5 Replies)
Discussion started by: Phuti
5 Replies

9. Shell Programming and Scripting

Confirming validity of programming language tools

so i have scripts that get run in ways similar to this: cat script.pl | perl - $1 $2 $3 cat script.rb | ruby - $1 $ 2 $3 my question is, how can i verify that that the "perl" or "ruby" or "python" tool being run on the box is actually a legit tool? meaning, someone may move the tool from... (2 Replies)
Discussion started by: SkySmart
2 Replies

10. UNIX for Beginners Questions & Answers

Another one line command where I'd like to determine if Ubuntu or Red Hat when running command

Hello Forum, I'm making very good progress on my report thanks to the very helpful people on this forum. I've been able to successfully create my report for my Red Hat servers. But I do have a few ubuntu servers in the mix and I'd like to capture some data from them when an ssh connection is... (8 Replies)
Discussion started by: greavette
8 Replies
NFSD(8) 						    BSD System Manager's Manual 						   NFSD(8)

NAME
nfsd -- remote NFS server SYNOPSIS
nfsd [-6rut] [-n num_threads] DESCRIPTION
nfsd runs on a server machine to service NFS requests from client machines. At least one nfsd must be running for a machine to operate as a server. Unless otherwise specified, four servers for UDP transport are started. The following options are available: -r Register the NFS service with rpcbind(8) without creating any servers. This option can be used along with the -u or -t options to re-register NFS if the portmap server is restarted. -n Specifies how many server threads to create. The default is 4. A server should run enough threads to handle the maximum level of concurrency from its clients. -6 Listen to IPv6 requests as well as IPv4 requests. If IPv6 support is not available, nfsd will silently continue and just use IPv4. -t Serve TCP NFS clients. -u Serve UDP NFS clients. For example, ``nfsd -t -u -n 6'' serves UDP and TCP transports using six threads. nfsd listens for service requests at the port indicated in the NFS server specification; see Network File System Protocol Specification, RFC 1094 and NFS: Network File System Version 3 Protocol Specification. The nfsd utility exits 0 on success, and >0 if an error occurs. SEE ALSO
nfsstat(1), nfssvc(2), mountd(8), rpcbind(8) HISTORY
The nfsd utility first appeared in 4.4BSD. BSD
March 17, 2008 BSD
All times are GMT -4. The time now is 01:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy