Sponsored Content
Full Discussion: Help with Script please
Top Forums Shell Programming and Scripting Help with Script please Post 302842521 by Skrynesaver on Friday 9th of August 2013 11:55:38 AM
Old 08-09-2013
Your assignment of the literal value is not being interpreted the way you think it is, the double quotd are being interpreted by the shell.

Try asssgning the value to result from a process directly, or compare to the snippet below:
Code:
result='<RETURN status="FAILED" number="5101">Invalid value for "add_host_ips" : 192.168.1.55 (not assigned to AG owner). IPs do not exist in the license or user account.</RETURN>'
status=$(echo $result|sed 's/^.*status="\([^"]*\)".*$/\1/')
echo $status

 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

2. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

5. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
IMAP_STATUS(3)								 1							    IMAP_STATUS(3)

imap_status - Returns status information on a mailbox

SYNOPSIS
object imap_status (resource $imap_stream, string $mailbox, int $options) DESCRIPTION
Gets status information about the given $mailbox. PARAMETERS
o $ imap_stream -An IMAP stream returned by imap_open(3). o $mailbox - The mailbox name, see imap_open(3) for more information o $options - Valid flags are: o SA_MESSAGES - set $status->messages to the number of messages in the mailbox o SA_RECENT - set $status->recent to the number of recent messages in the mailbox o SA_UNSEEN - set $status->unseen to the number of unseen (new) messages in the mailbox o SA_UIDNEXT - set $status->uidnext to the next uid to be used in the mailbox o SA_UIDVALIDITY - set $status->uidvalidity to a constant that changes when uids for the mailbox may no longer be valid o SA_ALL - set all of the above RETURN VALUES
This function returns an object containing status information. The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity. flags is also set, which contains a bitmask which can be checked against any of the above constants. EXAMPLES
Example #1 imap_status(3) example <?php $mbox = imap_open("{imap.example.com}", "username", "password", OP_HALFOPEN) or die("can't connect: " . imap_last_error()); $status = imap_status($mbox, "{imap.example.org}INBOX", SA_ALL); if ($status) { echo "Messages: " . $status->messages . "<br /> "; echo "Recent: " . $status->recent . "<br /> "; echo "Unseen: " . $status->unseen . "<br /> "; echo "UIDnext: " . $status->uidnext . "<br /> "; echo "UIDvalidity:" . $status->uidvalidity . "<br /> "; } else { echo "imap_status failed: " . imap_last_error() . " "; } imap_close($mbox); ?> PHP Documentation Group IMAP_STATUS(3)
All times are GMT -4. The time now is 02:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy