Sponsored Content
Top Forums Shell Programming and Scripting Taking error message from XML file, amending to script Post 302792415 by Yoda on Wednesday 10th of April 2013 11:18:23 AM
Old 04-10-2013
You could code something like:
Code:
#!/bin/bash

Command.sh errors | while read line
do
        if [[ "$line" =~ ^ID: ]]                # Check if line starts with pattern - "ID:"
        then
                id=${line#ID:}                  # Remove string - "ID:" from beginning of line
                id=${id%%<*}                    # Remove string - < followed by all chars - "<*"
                Command.sh fix "$id"            # Run fix script by passing "$id" as argument
        fi
done

This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

counting words then amending to a file

i want to count the number of words in a file and then redirect this to a file echo 'total number of words=' wc -users>file THis isnt working, anyone any ideas. (1 Reply)
Discussion started by: iago
1 Replies

2. Shell Programming and Scripting

How to remove xml namespace from xml file using shell script?

I have an xml file: <AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Table1> <Data1 10 </Data1> <Data2 20 </Data2> <Data3 40 </Data3> <Table1> </AutoData> and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only. I tried using sed... (10 Replies)
Discussion started by: Gary1978
10 Replies

3. Shell Programming and Scripting

Need to extract XML message from log

I need help to extract a following SOAP-ENV:Header XML message from the log. XML message need to be extracted: *************************** <SOAP-ENV:Header> <ServiceGatewayHeader> <SourceApplicationId>OXL</SourceApplicationId> <Version>1.0</Version> <UserId>TEST</UserId>... (4 Replies)
Discussion started by: tjshankar
4 Replies

4. Shell Programming and Scripting

script for taking the stats from a file

i have file which contains data like this every day.i need to pull up a report for counting the 203's in that file for each subscriber id.there are around 200 subscriber id's. all ths Y's which i have written in the script are the subscriber id's.could some one give me an idea as to how do it in... (22 Replies)
Discussion started by: archana234
22 Replies

5. Shell Programming and Scripting

Self referencing script error message

Hello again all. I have a user editable script that I'd like to have point out the user error to. Problem is I'm having troubles getting an echoed error message to give me the line. Here's what I'm trying to do. grep -n $loc /this/script.sh where '$loc' is the argument passed to the script.... (9 Replies)
Discussion started by: DC Slick
9 Replies

6. Shell Programming and Scripting

Extract XML message from a log file using awk

Dear all I have a log file and the content like this file name: temp.log <?xml version="1.0" encoding="cp850"?> <!DOCTYPE aaabbb SYSTEM '/dtdpath'> <aaabbb> <tranDtl> <msgId>000001</msgId> </tranDtl> ..... </aaabbb> ... ... (1 Reply)
Discussion started by: on9west
1 Replies

7. Programming

[XQuery] How to Convert from JSON Message to XML Message with XQuery

Hi guys, I'm in a job of converting a restful webservice to soap. Tool for convertation uses XQuery. Now i need to convert a message like this: { "firstName": "John", "midName": null, "lastName": "Smith", "married": false, "address": { "streetAddress": "21 2nd... (5 Replies)
Discussion started by: tien86
5 Replies

8. Shell Programming and Scripting

How to deliver an error message from script?

Hi I have a script that pick up a file on another server, and place it on a solaris server, but I came across the following error: mget HLR01_21092014? 200 Port command successful 150 Opening data channel for file transfer. HLR01_21092014: No space left on device 426 Connection closed;... (18 Replies)
Discussion started by: fretagi
18 Replies

9. UNIX for Beginners Questions & Answers

UNIX script error message

Greeting!! I wrote the below script to e-mail me only file names in a specific directory when a file is delayed for some time in a that directory. I am getting unexpected eof error message. I don't want any email if the folder is blank.(if the condition is not met) I am not getting the email at... (4 Replies)
Discussion started by: Hope
4 Replies

10. UNIX for Beginners Questions & Answers

UNIX script error message

I have this UNIX script code with a query to export sql table in Oracle and export to csv file. The code gets the data correctly. However, when I run the script second time, I got the error message "not spooling currently" and shows the older data in csv file. When I delete the csv file and run... (5 Replies)
Discussion started by: Hope
5 Replies
rcinet(8)						      System Manager's Manual							 rcinet(8)

NAME
rcinet - Restarts, starts, or stops Internet network services on the system SYNOPSIS
/usr/sbin/rcinet option OPTIONS
You must specify one of the following options with the rcinet command: Restarts the network on the system. Starts the network on the sys- tem. Stops the network on the system. You can restrict the restart, start, or stop operation to either IPv4 or IPv6 networks by specifying inet or inet6, respectively, as the second parameter. By default, the script assumes both IPv4 and IPv6. DESCRIPTION
The rcinet script allows system administrators to restart, start, or stop the Internet network services on the system while it is running in multiuser mode by using one of the options. RESTRICTIONS
Superuser privilege is required. Warn users that the system is being removed from the network. File systems that were not mounted using the /etc/fstab file or the automount command must be unmounted with the umount command. You must remount these file systems using the mount command after the network is started on your system. ERRORS
The rcinet script prints an error message to stderr if the network is not configured on the system. FILES
The network shell scripts are located in /sbin/init.d with symbolic links in /sbin/rc0.d and /sbin/rc3.d. SEE ALSO
Commands: mount(8) Network Administration rcinet(8)
All times are GMT -4. The time now is 01:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy