Script Language Parser for Learning


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script Language Parser for Learning
# 1  
Old 03-30-2008
Script Language Parser for Learning

I'm new to the UNIX world and have to learn scripting for my job. Presented with multiple scripts to learn (and then have to maintain in the future) is there a utility or process to input a script in it's native form and output what each line would look like fully parsed (i.e.: all variable names substituted with their values) WITHOUT executing the script. This way, I can look at the source code script and the end-result post-parsed output and learn by compaing the two.

Any help would be appreciated. Thanks.
# 2  
Old 03-30-2008
You mean shell scripts, specifically? Look at sh -n -v -x or some subset of those switches. With -n it won't attempt to figure out the values of variables, either, though. In your typical nontrivial shell script, variable values are assigned highly dynamically so you really in practice do need to execute a script in order to see what's going on in the variables.
# 3  
Old 03-30-2008
Quote:
Originally Posted by era
You mean shell scripts, specifically? Look at sh -n -v -x or some subset of those switches. With -n it won't attempt to figure out the values of variables, either, though. In your typical nontrivial shell script, variable values are assigned highly dynamically so you really in practice do need to execute a script in order to see what's going on in the variables.
Thanks for such a quck respose. I can route (pipe) the output from this command via std err to a file so I can examine it. Right? And if I read the -x correctly, each line in the output would be the fully parsed line that would be executed (preceeded by a "+"). Right again?

Sorry if these are simplistic questions...
# 4  
Old 03-30-2008
Try it so you won't have to ask (^: but yes.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Learning to Script in Linux

Hello, I'm trying to branch out and learn Linux, but my comfort zone is PowerShell. I figure the best way to learn it is to do it so I moved my Plex Media Server to Ubuntu Server. What I'm trying to do is build a script that searches a directory and all subdirectories for files with the .ts... (5 Replies)
Discussion started by: Rhysers
5 Replies

2. Programming

Learning python, lost with script

Hi there, im just having a hard time understanding why this code does not print anything that is suppose to print: score = raw_input ('what is your score? \n') try: if 1.0 == float(score) >= 0.9: print "A" elif 0.9 > float(score) >= 0.8: ... (1 Reply)
Discussion started by: la2015
1 Replies

3. Shell Programming and Scripting

Language of the script

Hi, Can you let me know in which language is the below scrip written. @echo "*** PREINSTALL STARTED ***" @echo "---> Verify existence of top level directories and creating them " -$(INS) -d -m 755 $(DEST_PLUGIN_EXPORT_DIR) -$(INS) -d -m 755 $(DEST_PLUGIN_DOCS_DIR) ... (3 Replies)
Discussion started by: @bhi
3 Replies

4. Programming

What Programming language should I start learning first?

I want to create a computer program that will translate from English to Spanish and vice versa. So someone could type in a word, phrase, or paragraph and translate from one language to another. What programming language would I use to write up the code and then implement this program? I want to... (8 Replies)
Discussion started by: Anna Hussie
8 Replies

5. UNIX Desktop Questions & Answers

Unix shell script learning

I am trying to learn Shell scripting in UNIX. Could Any one please suggest on how to get UNIX account or any other free stimulator available for download on which I can practice Unix shell script? Thanks, sam70 (9 Replies)
Discussion started by: sam70
9 Replies

6. UNIX for Dummies Questions & Answers

What script/language/command should i use?

This maybe the dumpiest question you've ever been asked..but i've been browsing, searching and understanding lots of information that i get from the internet..i'm confused that i might be in the wrong way in understanding it since i have to do a system that count and build up a statistics for a... (5 Replies)
Discussion started by: meggae
5 Replies

7. UNIX for Dummies Questions & Answers

Learning Tips - UNIX Shell Script

Can any one please provide a fast learning tips to learn UNIX shell scripting? Thanks, Gov (3 Replies)
Discussion started by: Govindh.v
3 Replies

8. UNIX for Dummies Questions & Answers

learning how to script

I have this command line entry that I would like to turn into a script. I want to be able to just run the script with options for the report name and switch. Can anyone help me get started? I am hoping that by creating this script it will help me be able to create more. I have never written one. I... (11 Replies)
Discussion started by: llsmr777
11 Replies

9. Shell Programming and Scripting

learning how to use shell script

hello everyone, i am still trying to get this script to work, but with no luck. It is a little beyond my knowledge of scripting at the moment. The beginner book i have has an exercise listed that asks me to write a script tha allows for user input. For example " what is your name: " and then you... (3 Replies)
Discussion started by: bebop1111116
3 Replies

10. UNIX for Dummies Questions & Answers

Learning to script...want a project to work on (making a small MUD)

Will it be possible to make a MUD using unix script(bash)? I know I can easilly make a "dungeon" with different rooms I can run through and such(kinda like a maze game) . What I did was made a differnt shell script for each room and used CASE for the different places to go, ex. when you press N for... (2 Replies)
Discussion started by: learningtoscrip
2 Replies
Login or Register to Ask a Question