Thanks but i dont know how to tell the command to break if we have error message. for example:
first execute will be ok but the if i execute it again the command return error message that name=1 is exists and so on.
i want to exist the command from the first error and write it to a file. is that possible?
thanks
Moderator's Comments:
Please use CODE tags when displaying sample input, sample output, and code segments.
Last edited by Don Cragun; 07-21-2016 at 07:25 PM..
Reason: Add CODE tags.
Guys any tips on printing a certain error message to stderr and exiting should a command fail within a ksh script? I'm trying to null some output files.
Touch isn't suitable as i need to null them.
print "" > file isn't suitable as i need to check elsehere for if they are 0bytes or not.
... (5 Replies)
Hi All,
I have developed below script for FTP a file from unix machine to another machine.
ftpToABC ()
{
USER='xyz'
PASSWD='abc'
echo "open xx.yy.zbx.aaa
user $USER $PASSWD
binary
echo "put $1 abc.txt" >> /home/tmp/ftp.$$
echo "quit" >> /home/tmp/ftp.$$
ftp -ivn <... (3 Replies)
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)
Hello All
My req is to store the exit status of a command in shell variable
I want to check whether the file has header or not
The header will contain the string
DATA_ACQ_CYC_CNTL_ID
So I am running the command
head -1 $i | grep DATA_ACQ_CYC_CNTL_ID
Now I have to check if... (6 Replies)
Hi,
Can anyone help me how to exit a shell script if a unix command inside does not return any value for 10 seconds?
The scenarios is like this.
I want to login to a application using shell script where the connection string is mentioned.but suppose this connection string is not... (10 Replies)
Hi,
I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to exit from CLI object (not from shell script) in my shell script.
My intension is to execute... (4 Replies)
Hi,
I am looking for a generic find command that works on both Linux and Solaris.
I have the below command that works fine on Linux but fails on solaris.find /web/config -type f '(' -name '*.txt' -or -name '*.xml' -name '*.pro' ')' Fails on SunOS mysolaris 5.10 Generic_150400-61 sun4v sparc... (1 Reply)
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
LEARN ABOUT DEBIAN
tk_messagebox
tk_messageBox(3tk) Tk Built-In Commands tk_messageBox(3tk)__________________________________________________________________________________________________________________________________________________NAME
tk_messageBox - pops up a message window and waits for user response.
SYNOPSIS
tk_messageBox ?option value ...?
_________________________________________________________________DESCRIPTION
This procedure creates and displays a message window with an application-specified message, an icon and a set of buttons. Each of the but-
tons in the message window is identified by a unique symbolic name (see the -type options). After the message window is popped up, tk_mes-
sageBox waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button.
The following option-value pairs are supported:
-default name
Name gives the symbolic name of the default button for this message window ( "ok", "cancel", and so on). See -type for a list of the
symbolic names. If this option is not specified, the first button in the dialog will be made the default.
-detail string
Specifies an auxiliary message to the main message given by the -message option. Where supported by the underlying OS, the message |
detail will be presented in a less emphasized font than the main message.
-icon iconImage
Specifies an icon to display. IconImage must be one of the following: error, info, question or warning. If this option is not speci-
fied, then the info icon will be displayed.
-message string
Specifies the message to display in this message box.
-parent window
Makes window the logical parent of the message box. The message box is displayed on top of its parent window.
-title titleString
Specifies a string to display as the title of the message box. The default value is an empty string.
-type predefinedType
Arranges for a predefined set of buttons to be displayed. The following values are possible for predefinedType:
abortretryignore Displays three buttons whose symbolic names are abort, retry and ignore.
ok Displays one button whose symbolic name is ok.
okcancel Displays two buttons whose symbolic names are ok and cancel.
retrycancel Displays two buttons whose symbolic names are retry and cancel.
yesno Displays two buttons whose symbolic names are yes and no.
yesnocancel Displays three buttons whose symbolic names are yes, no and cancel.
EXAMPLE
set answer [tk_messageBox -message "Really quit?"
-icon question -type yesno
-detail "Select "Yes" to make the application exit"]
switch -- $answer {
yes exit
no {tk_messageBox -message "I know you like this application!"
-type ok}
}
KEYWORDS
message box
Tk 4.2 tk_messageBox(3tk)