How to ask for a path from the user in XML and shell?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to ask for a path from the user in XML and shell?
# 1  
Old 06-19-2013
How to ask for a path from the user in XML and shell?

I am working on a small plugin for Galaxy, which is written in shell script.The XML wrapper shows multiple options of paths where the user would like to store the file. I now want to add an option where the user can specify the path. Also,he can specify the name of the output file.As I am new to XML and Shell, I would be grateful for any suggestions. Many thanks in advance.
# 2  
Old 06-19-2013
Well, if they pick that option from the list, it needs to be detected before processing the answer, and an additional field or read needs to get the choice. Do you want to accept only directories already there? You can make them with mkdir -p all at once, but that might introduce too much chaos. You might want to check writability of the directory and any file overwritten. Do you allow file overwrite now?
# 3  
Old 06-19-2013
As of now, they can select specified directories. I want them to select an option saying something like "Different path" and then they se a text box where they write the path.
# 4  
Old 06-19-2013
But what if the directories in that path do not exist? Normally, that raises an error.
# 5  
Old 06-19-2013
Ya, thats right. So, it should validate the path or make the directory .
So, how do I go about it?
# 6  
Old 06-19-2013
Which shell? bash has a read that can prompt the user and load a shell variable with the answer. If it is a directory, you can test it with 'if [ -d "$varname" ]' and 'if [ -w "$varname" ]' to ensure existence and writability, respectively.
This User Gave Thanks to DGPickett For This Post:
# 7  
Old 06-19-2013
I shall try it out tomorrowSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to pull multiple XML tags from the same XML file in Shell.?

I'm searching for the names of a TV show in the XML file I've attached at the end of this post. What I'm trying to do now is pull out/list the data from each of the <SeriesName> tags throughout the document. Currently, I'm only able to get data the first instance of that XML field using the... (9 Replies)
Discussion started by: hungryd
9 Replies

2. Shell Programming and Scripting

How to do user-preset login to Bash shell then automate path modification?

How do a user login with full user-environment preset to Bash shell then automatically do path modification with few script codes, either on command-line or put it in a script file. what i tried: bash --login -c PATH="/ANewPath:${PATH}" bash --login -c 'PATH="/ANewPath:${PATH}"; export PATH'... (2 Replies)
Discussion started by: abdulbadii
2 Replies

3. Shell Programming and Scripting

How to add Xml tags to an existing xml using shell or awk?

Hi , I have a below xml: <ns:Body> <ns:result> <Date Month="June" Day="Monday:/> </ns:result> </ns:Body> i have a lookup abc.txtt text file with below details Month June July August Day Monday Tuesday Wednesday I need a output xml with below tags <ns:Body> <ns:result>... (2 Replies)
Discussion started by: Nevergivup
2 Replies

4. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

5. Shell Programming and Scripting

Appending a path in user's PATH variable

Hello Folks, I want to append a path in user's PATH variable which should be available in current session. Background Numerous persons will run a utility. Aim is to add the absolute path of the utility the first time it runs so that next runs have the PATH in env & users can directly run... (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

6. Programming

DOM query selected path and show as xml

First, I am sorry if this question not this room scope, I have a XML file : file: book.xml <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="COOKING"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> ... (3 Replies)
Discussion started by: penyu
3 Replies

7. Shell Programming and Scripting

Executing Commands From Non-Standard Path (Changing user's PATH secretely???)

Hi: I have a requirement as below: I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l). When any user logs on and types... (2 Replies)
Discussion started by: ramesh_samane
2 Replies

8. UNIX for Dummies Questions & Answers

$path tied to $PATH in C shell?

Hi: It seems that the shell variable $path is tied to the environment variable $PATH in C shell. Is this true? Is there a way to keep them separated so changes in $PATH won't be reflected in $path? Thanks. (2 Replies)
Discussion started by: phil518
2 Replies

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

10. UNIX for Dummies Questions & Answers

mistyped shell path, now i can't login as the only user that can su to root

i mistyped the location of bash and now i can't login as the only other user who belongs to wheel on my freebsd box. since i'm having many problems with samba, this has frozen my attempts to get things resolved with the former issue. i've been told that 'su -m' should do the trick, but it's... (3 Replies)
Discussion started by: xyyz
3 Replies
Login or Register to Ask a Question