Sponsored Content
Top Forums Shell Programming and Scripting Script to check one command and if it fails moves to other command Post 302811949 by aix_admin_007 on Friday 24th of May 2013 03:38:27 PM
Old 05-24-2013
let me say the sequence of checks and script checks

Firstly in "lsvg | grep old" here if the output is "old_rootvg", script would then delete it by "alt_rootvg_op -X old_rootvg", and check again "lsvg | grep old" if no output then "old_rootvg" is deleted, if output is shown as "old_rootvg" existing, then script would "exportvg old_rootvg".
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

SH script, variable built command fails, but works at command line

I am working with a sh script on a solaris 9 zone (sol 10 host) that grabs information to build the configuration command line. the variables Build64, SSLopt, CONFIGopt, and CC are populated in the script. the script includes CC=`which gcc` CONFIGopt=' --prefix=/ --exec-prefix=/usr... (8 Replies)
Discussion started by: oly_r
8 Replies

3. Shell Programming and Scripting

File check script fails for multiple files

I want to check if any file with testing*.txt exists but my script fails if more than 1 file exists. It works fine for a single file if then echo "TEST21" fi -------------- bash: How do I fix this? Thanks Please use code tags next time for your code and data. (8 Replies)
Discussion started by: sumang24
8 Replies

4. Shell Programming and Scripting

Except script fails to check file exists or not in remote node

Dear members, The following expect script connects to remote node and check for the file "authorized_keys" in directory /root/.ssh in remote node. However the result is always found even if the file exist or doesn't exist. expect { "$fname" { send_user "found\n" } Any idea what is... (4 Replies)
Discussion started by: Sudhakar333
4 Replies

5. Shell Programming and Scripting

Command to check only Autosys running jobs with autorep like command

Hi, Is there any specific command to use to check only say Running jobs via autorep or similar command for Autosys? (0 Replies)
Discussion started by: sidnow
0 Replies

6. Homework & Coursework Questions

Script performs the right task but fails against check

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a script checkFiles.sh that takes an arbitrary number of file paths from the command line and carries ... (5 Replies)
Discussion started by: Ezraek
5 Replies

7. UNIX for Beginners Questions & Answers

Linux shell | how to exit a script if any command fails.

Hi, i am new here let me say HI for all. now i have a question please: i am sending one command to my machine to create 3 names. if one of the names exists then the box return error message that already have the name but will continue to create the rests. How i can break the command and... (7 Replies)
Discussion started by: Amiri
7 Replies

8. Cybersecurity

Use command 2 incase command 1 fails

I try to fire grep command on remote servers using ssh like below: sshpass -p mypassword ssh -t user1@mach2 "grep -e word1 -e word2 /var/out.txt" The issue is that i wish to run the same grep command which searches for multiple strings in a file on remote servers with different Operating... (6 Replies)
Discussion started by: mohtashims
6 Replies

9. Shell Programming and Scripting

Replace string works on command-line but fails when run from shell script

I wish to replace "\\n" with a single white space. The below does the job on command-line: $ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g'; /fin/app/scripts /fin/app/01/sql However, when i have the same code to a shell script it is not able to get me the same output:... (8 Replies)
Discussion started by: mohtashims
8 Replies

10. UNIX for Beginners Questions & Answers

Shell script to check a command executed sucessfully or not

Hi All, I am trying to write a shell script to check if a command executed successfully or not in rhel 7 and finding the installed tomcat version. I am using below script. var4=$(find / -name "catalina.jar" ! -size 0 |egrep -v... (6 Replies)
Discussion started by: sravani25
6 Replies
lpmove(1M)						  System Administration Commands						lpmove(1M)

NAME
lpmove - move print requests SYNOPSIS
lpmove [request-ID] destination lpmove destination1 destination2 DESCRIPTION
The lpmove command moves print requests queued by lp(1) or lpr(1B) between destinations. The first form of lpmove moves specific print requests (request-ID) to a specific destination. The second form of the lpmove command moves all print requests from one destination (destination1) to another (destination2). This form of lpmove also rejects new print requests for destination1. lpmove moves individual requests or entire queues only between local printers or between remote printers, not between a local and a remote printer. You can move only requests that were not previously transferred to the server. When moving requests, lpmove does not check the acceptance status of the destination to which the print requests are being moved (see accept(1M)). lpmove does not move requests that have options (for example, content type or requiring a special form) that cannot be handled by the new destination. OPERANDS
The following operands are supported: request-ID The specific print request to be moved. Specify request-ID as the identifier associated with a print request as reported by lpstat. See lpstat(1). destination The name of the printer or class of printers (see lpadmin(1M)) to which lpmove moves a specified print request. Specify destination using atomic, POSIX-style (server:destination) syntax. destination1 The name of the destination from which lpmove moves all print requests. Specify destination using atomic, POSIX-style (server:destination) syntax. destination2 The name of the destination to which lpmove moves all print requests. Specify destination using atomic, POSIX-style (server:destination) syntax. See printers.conf(4) for information regarding the naming conventions for atomic names and standards(5) for information regarding POSIX. EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error occurred. FILES
/var/spool/print/* LP print queue. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpcu | +-----------------------------+-----------------------------+ SEE ALSO
lp(1), lpr(1B), lpstat(1), accept(1M), lpadmin(1M), lpsched(1M), printers.conf(4), attributes(5), standards(5) System Administration Guide: Advanced Administration SunOS 5.10 8 Feb 2001 lpmove(1M)
All times are GMT -4. The time now is 02:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy