Sponsored Content
Top Forums Shell Programming and Scripting Read xml file till script finds separation and run again for next input and so on Post 302967113 by rv_champ on Friday 19th of February 2016 12:08:11 PM
Old 02-19-2016
Read xml file till script finds separation and run again for next input and so on

Hi All,
I have one query, I managed to run script with user inputs through command line or with 1 file.
But I need to read a txt file/xml file in which user can mention multiple sets of answers and script should run for each set till it reach the EOF.
Thanks in advance
for example, the file will looks like:
Code:
1)
name=java-tree
path=/home/tamt/java-tree
value=100
type=solid
######################
2)
name=dotnet-tree
path=/home/tamt/dotnet-tree
value=80
type=solid
######################
3)
name=shell-tree
path=/home/tamt/shell-tree
value=50
type=comp
######################


Last edited by Franklin52; 02-19-2016 at 01:10 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need to read a file and keep waiting till it satisfies some condition

In my script i am writing to a counter file the no of processes i had started, that is each time i start a process, i will increment the content of counter file and also when the process ends i will decrement the content of the file. after this i do some other activities, by now i want to... (1 Reply)
Discussion started by: senthilk615
1 Replies

2. Post Here to Contact Site Administrators and Moderators

how to read a file till it encounters a blank line

Hi , I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this. e.g:- * PK Sent Email (11.23) CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS:... (0 Replies)
Discussion started by: adityam
0 Replies

3. Shell Programming and Scripting

Need a script that will read from 2 input file

Hi Everyone. I am new in this scripting world. I need to know about script that I can use on linux/sun operating systems. I have 2 input file. File 1: Its has an header information and then data in 2 different columns. File 2 : It has data in 9 different columns/ I need an script that... (3 Replies)
Discussion started by: syahmed
3 Replies

4. Shell Programming and Scripting

Unix Script to read the XML file from Website

Hi Experts, I need a unix shell script which can copy the xml file from the below pasted website and paste in in my unix directory. http://www.westpac.co.nz/olcontent/olcontent.nsf/fx.xml Thanks in Advance... (8 Replies)
Discussion started by: phani333
8 Replies

5. Shell Programming and Scripting

script to read XML file

Dear All, I have one log file and it contains lot of XML as below. ... (1 Reply)
Discussion started by: murtujak
1 Replies

6. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

7. Shell Programming and Scripting

Shell Script to read XML file

Hi unix Gurus, I am really new to Unix Scripting. Please help me to create a shell script which reads the xml file and from that i need to fetch a particular information. For example <SOURCE BUSINESSNAME ="" DATABASETYPE ="Teradata" DBDNAME ="DWPROD3" DESCRIPTION ="" NAME... (5 Replies)
Discussion started by: SmilePlease
5 Replies

8. Red Hat

How to read an xml file through shell script?

Hey , can we read an xml file and make changes in it through shell script. Thanks (4 Replies)
Discussion started by: ramsavi
4 Replies

9. Shell Programming and Scripting

Bash script to read a file from particular line till required line and process

Hi All, Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool. Wraper script am trying is to do with above metion 2 files. utility tool accepts : a. userinfo file : which contains username b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies

10. Shell Programming and Scripting

Script does not read input file

Hi everyone, I have problems with this script. This script should check for a folder for each server in the list of the list.txt file. The script only checks the first host, and then exits, why? #!/bin/bash file='/etc/list.txt' while read line; do echo $line if ssh root@$line "stat /var >... (2 Replies)
Discussion started by: nashrik
2 Replies
GIT-SH-SETUP(1) 						    Git Manual							   GIT-SH-SETUP(1)

NAME
       git-sh-setup - Common Git shell script setup code

SYNOPSIS
       . "$(git --exec-path)/git-sh-setup"

DESCRIPTION
       This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish
       scripts and/or are writing new ones.

       The git sh-setup scriptlet is designed to be sourced (using .) by other shell scripts to set up some variables pointing at the normal Git
       directories and a few helper shell functions.

       Before sourcing it, your script should set up a few variables; USAGE (and LONG_USAGE, if any) is used to define message given by usage()
       shell function. SUBDIRECTORY_OK can be set if the script can run from a subdirectory of the working tree (some commands do not).

       The scriptlet sets GIT_DIR and GIT_OBJECT_DIRECTORY shell variables, but does not export them to the environment.

FUNCTIONS
       die
	   exit after emitting the supplied error message to the standard error stream.

       usage
	   die with the usage message.

       set_reflog_action
	   Set GIT_REFLOG_ACTION environment to a given string (typically the name of the program) unless it is already set. Whenever the script
	   runs a git command that updates refs, a reflog entry is created using the value of this string to leave the record of what command
	   updated the ref.

       git_editor
	   runs an editor of user's choice (GIT_EDITOR, core.editor, VISUAL or EDITOR) on a given file, but error out if no editor is specified
	   and the terminal is dumb.

       is_bare_repository
	   outputs true or false to the standard output stream to indicate if the repository is a bare repository (i.e. without an associated
	   working tree).

       cd_to_toplevel
	   runs chdir to the toplevel of the working tree.

       require_work_tree
	   checks if the current directory is within the working tree of the repository, and otherwise dies.

       require_work_tree_exists
	   checks if the working tree associated with the repository exists, and otherwise dies. Often done before calling cd_to_toplevel, which
	   is impossible to do if there is no working tree.

       require_clean_work_tree <action> [<hint>]
	   checks that the working tree and index associated with the repository have no uncommitted changes to tracked files. Otherwise it emits
	   an error message of the form Cannot <action>: <reason>. <hint>, and dies. Example:

	       require_clean_work_tree rebase "Please commit or stash them."

       get_author_ident_from_commit
	   outputs code for use with eval to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit.

       create_virtual_base
	   modifies the first file so only lines in common with the second file remain. If there is insufficient common material, then the first
	   file is left empty. The result is suitable as a virtual base input for a 3-way merge.

GIT
       Part of the git(1) suite

Git 2.17.1							    10/05/2018							   GIT-SH-SETUP(1)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy