473,326 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Passing parameters to .sh file from a perl file

3
In reference to: Passing parameters to .sh file from a perl file

Hey guys, since this thread isn't too terribly old, I thought I'd just add to it, since I'm having a similar problem.

I need to do kind of the same thing, only I can't edit the perl file I'm accessing. (Well, I can, but I really shouldn't)

The perl file that I need to get parameters from just contains a bunch of subroutines. Within each subroutine is a list of variables (all the variables' names are the same in the different subroutines, but their values are different)

I need to be able to specify to take x variable from x subroutine, and assign it to x variable in my shell script.

I hope I'm making sense. Actually, now that I look at the file, I'm not even sure they are subroutines. I just need to know how to get the variables in each of these different subroutines into my shell script. The file is below. Any ideas?

Expand|Select|Wrap|Line Numbers
  1. handle 1 {
  2. list UG_TS_UT 6 {
  3. UG_TS_UT {
  4. UG_TS_UT_TITLE = "Template1";
  5. UG_TS_UT_HDPATH = "/home";
  6. UG_TS_UT_SUP = "/usr/bin/keysh";
  7. UG_TS_UT_PGRP = "ifmisusr";
  8. UG_TS_UT_ALTSTR = NULL;
  9. UG_TS_UT_BOOTSU = "NO";
  10. UG_TS_UT_PWDFSGP = "DFT";
  11. UG_TS_UT_PWDFSGC = "DFT";
  12. UG_TS_UT_PWDFSGL = "DFT";
  13. UG_TS_UT_PWDFUSP = "DFT";
  14. UG_TS_UT_PWDFERR = "DFT";
  15. UG_TS_UT_PWDFNUL = "DFT";
  16. UG_TS_UT_PWDFLEN = -1;
  17. UG_TS_UT_PGID = 106;
  18. UG_TS_UT_UIDVAL1 = NULL;
  19. UG_TS_UT_UIDVAL2 = NULL;
  20. UG_TS_UT_LOGENV = NULL;
  21. UG_TS_UT_UIDMETH = 1;
  22. UG_TS_UT_INCCOM = 1;
  23. UG_TS_UT_ACCACT = 1;
  24. UG_TS_UT_ALTTYPE = 1;
  25. UG_TS_UT_ACCLFTM = -1;
  26. UG_TS_UT_MAXPOI = -1;
  27. UG_TS_UT_UNSUCLT = -1;
  28. UG_TS_UT_PWDAGING = -1;
  29. UG_TS_UT_PWDTBC = -1;
  30. UG_TS_UT_PWDEXPT = -1;
  31. UG_TS_UT_PWDWARN = -1;
  32. UG_TS_UT_PWDLFTM = -1;
  33. UG_TS_UT_PWDOPT = -1;
  34. UG_TS_UT_CRHD = 1;
  35. UG_TS_UT_PSD = 1;
  36. };
  37. UG_TS_UT {
  38. UG_TS_UT_TITLE = "Template2";
  39. UG_TS_UT_HDPATH = "/home";
  40. UG_TS_UT_SUP = "/usr/bin/csh";
  41. UG_TS_UT_PGRP = "ifmisusr";
  42. UG_TS_UT_ALTSTR = NULL;
  43. UG_TS_UT_BOOTSU = "NO";
  44. UG_TS_UT_PWDFSGP = "DFT";
  45. UG_TS_UT_PWDFSGC = "DFT";
  46. UG_TS_UT_PWDFSGL = "DFT";
  47. UG_TS_UT_PWDFUSP = "DFT";
  48. UG_TS_UT_PWDFERR = "DFT";
  49. UG_TS_UT_PWDFNUL = "DFT";
  50. UG_TS_UT_PWDFLEN = -1;
  51. UG_TS_UT_PGID = 106;
  52. UG_TS_UT_UIDVAL1 = NULL;
  53. UG_TS_UT_UIDVAL2 = NULL;
  54. UG_TS_UT_LOGENV = NULL;
  55. UG_TS_UT_UIDMETH = 1;
  56. UG_TS_UT_INCCOM = 1;
  57. UG_TS_UT_ACCACT = 1;
  58. UG_TS_UT_ALTTYPE = 1;
  59. UG_TS_UT_ACCLFTM = -1;
  60. UG_TS_UT_MAXPOI = -1;
  61. UG_TS_UT_UNSUCLT = -1;
  62. UG_TS_UT_PWDAGING = -1;
  63. UG_TS_UT_PWDTBC = -1;
  64. UG_TS_UT_PWDEXPT = -1;
  65. UG_TS_UT_PWDWARN = -1;
  66. UG_TS_UT_PWDLFTM = -1;
  67. UG_TS_UT_PWDOPT = -1;
  68. UG_TS_UT_CRHD = 1;
  69. UG_TS_UT_PSD = 1;
  70. };
  71. UG_TS_UT {
  72. UG_TS_UT_TITLE = "Template3";
  73. UG_TS_UT_HDPATH = "/home";
  74. UG_TS_UT_SUP = "/usr/bin/keysh";
  75. UG_TS_UT_PGRP = "dnsc";
  76. UG_TS_UT_ALTSTR = NULL;
  77. UG_TS_UT_BOOTSU = "NO";
  78. UG_TS_UT_PWDFSGP = "DFT";
  79. UG_TS_UT_PWDFSGC = "DFT";
  80. UG_TS_UT_PWDFSGL = "DFT";
  81. UG_TS_UT_PWDFUSP = "DFT";
  82. UG_TS_UT_PWDFERR = "DFT";
  83. UG_TS_UT_PWDFNUL = "DFT";
  84. UG_TS_UT_PWDFLEN = -1;
  85. UG_TS_UT_PGID = 113;
  86. UG_TS_UT_UIDVAL1 = NULL;
  87. UG_TS_UT_UIDVAL2 = NULL;
  88. UG_TS_UT_LOGENV = NULL;
  89. UG_TS_UT_UIDMETH = 1;
  90. UG_TS_UT_INCCOM = 1;
  91. UG_TS_UT_ACCACT = 1;
  92. UG_TS_UT_ALTTYPE = 1;
  93. UG_TS_UT_ACCLFTM = -1;
  94. UG_TS_UT_MAXPOI = -1;
  95. UG_TS_UT_UNSUCLT = -1;
  96. UG_TS_UT_PWDAGING = -1;
  97. UG_TS_UT_PWDTBC = -1;
  98. UG_TS_UT_PWDEXPT = -1;
  99. UG_TS_UT_PWDWARN = -1;
  100. UG_TS_UT_PWDLFTM = -1;
  101. UG_TS_UT_PWDOPT = -1;
  102. UG_TS_UT_CRHD = 1;
  103. UG_TS_UT_PSD = 1;
  104. };
  105. UG_TS_UT {
  106. UG_TS_UT_TITLE = "Template4";
  107. UG_TS_UT_HDPATH = "/home";
  108. UG_TS_UT_SUP = "/usr/bin/csh";
  109. UG_TS_UT_PGRP = "dnsc";
  110. UG_TS_UT_ALTSTR = NULL;
  111. UG_TS_UT_BOOTSU = "NO";
  112. UG_TS_UT_PWDFSGP = "DFT";
  113. UG_TS_UT_PWDFSGC = "DFT";
  114. UG_TS_UT_PWDFSGL = "DFT";
  115. UG_TS_UT_PWDFUSP = "DFT";
  116. UG_TS_UT_PWDFERR = "DFT";
  117. UG_TS_UT_PWDFNUL = "DFT";
  118. UG_TS_UT_PWDFLEN = -1;
  119. UG_TS_UT_PGID = 113;
  120. UG_TS_UT_UIDVAL1 = NULL;
  121. UG_TS_UT_UIDVAL2 = NULL;
  122. UG_TS_UT_LOGENV = NULL;
  123. UG_TS_UT_UIDMETH = 1;
  124. UG_TS_UT_INCCOM = 1;
  125. UG_TS_UT_ACCACT = 1;
  126. UG_TS_UT_ALTTYPE = 1;
  127. UG_TS_UT_ACCLFTM = -1;
  128. UG_TS_UT_MAXPOI = -1;
  129. UG_TS_UT_UNSUCLT = -1;
  130. UG_TS_UT_PWDAGING = -1;
  131. UG_TS_UT_PWDTBC = -1;
  132. UG_TS_UT_PWDEXPT = -1;
  133. UG_TS_UT_PWDWARN = -1;
  134. UG_TS_UT_PWDLFTM = -1;
  135. UG_TS_UT_PWDOPT = -1;
  136. UG_TS_UT_CRHD = 1;
  137. UG_TS_UT_PSD = 1;
  138. };
  139. UG_TS_UT {
  140. UG_TS_UT_TITLE = "Template5";
  141. UG_TS_UT_HDPATH = "/home";
  142. UG_TS_UT_SUP = "/usr/bin/keysh";
  143. UG_TS_UT_PGRP = "airforce";
  144. UG_TS_UT_ALTSTR = NULL;
  145. UG_TS_UT_BOOTSU = "NO";
  146. UG_TS_UT_PWDFSGP = "DFT";
  147. UG_TS_UT_PWDFSGC = "DFT";
  148. UG_TS_UT_PWDFSGL = "DFT";
  149. UG_TS_UT_PWDFUSP = "DFT";
  150. UG_TS_UT_PWDFERR = "DFT";
  151. UG_TS_UT_PWDFNUL = "DFT";
  152. UG_TS_UT_PWDFLEN = -1;
  153. UG_TS_UT_PGID = 111;
  154. UG_TS_UT_UIDVAL1 = NULL;
  155. UG_TS_UT_UIDVAL2 = NULL;
  156. UG_TS_UT_LOGENV = NULL;
  157. UG_TS_UT_UIDMETH = 1;
  158. UG_TS_UT_INCCOM = 1;
  159. UG_TS_UT_ACCACT = 1;
  160. UG_TS_UT_ALTTYPE = 1;
  161. UG_TS_UT_ACCLFTM = -1;
  162. UG_TS_UT_MAXPOI = -1;
  163. UG_TS_UT_UNSUCLT = -1;
  164. UG_TS_UT_PWDAGING = -1;
  165. UG_TS_UT_PWDTBC = -1;
  166. UG_TS_UT_PWDEXPT = -1;
  167. UG_TS_UT_PWDWARN = -1;
  168. UG_TS_UT_PWDLFTM = -1;
  169. UG_TS_UT_PWDOPT = -1;
  170. UG_TS_UT_CRHD = 1;
  171. UG_TS_UT_PSD = 1;
  172. };
  173. UG_TS_UT {
  174. UG_TS_UT_TITLE = "Template6";
  175. UG_TS_UT_HDPATH = "/home";
  176. UG_TS_UT_SUP = "/usr/bin/csh";
  177. UG_TS_UT_PGRP = "airforce";
  178. UG_TS_UT_ALTSTR = NULL;
  179. UG_TS_UT_BOOTSU = "NO";
  180. UG_TS_UT_PWDFSGP = "DFT";
  181. UG_TS_UT_PWDFSGC = "DFT";
  182. UG_TS_UT_PWDFSGL = "DFT";
  183. UG_TS_UT_PWDFUSP = "DFT";
  184. UG_TS_UT_PWDFERR = "DFT";
  185. UG_TS_UT_PWDFNUL = "DFT";
  186. UG_TS_UT_PWDFLEN = -1;
  187. UG_TS_UT_PGID = 111;
  188. UG_TS_UT_UIDVAL1 = NULL;
  189. UG_TS_UT_UIDVAL2 = NULL;
  190. UG_TS_UT_LOGENV = NULL;
  191. UG_TS_UT_UIDMETH = 1;
  192. UG_TS_UT_INCCOM = 1;
  193. UG_TS_UT_ACCACT = 1;
  194. UG_TS_UT_ALTTYPE = 1;
  195. UG_TS_UT_ACCLFTM = -1;
  196. UG_TS_UT_MAXPOI = -1;
  197. UG_TS_UT_UNSUCLT = -1;
  198. UG_TS_UT_PWDAGING = -1;
  199. UG_TS_UT_PWDTBC = -1;
  200. UG_TS_UT_PWDEXPT = -1;
  201. UG_TS_UT_PWDWARN = -1;
  202. UG_TS_UT_PWDLFTM = -1;
  203. UG_TS_UT_PWDOPT = -1;
  204. UG_TS_UT_CRHD = 1;
  205. UG_TS_UT_PSD = 1;
  206. };
  207. };
  208. };
  209.  
Jul 23 '07 #1
5 992
KevinADC
4,059 Expert 2GB
looks like some kind of data file written in a format specfic to some kind of application. What makes you believe that is a perl file?
Jul 23 '07 #2
paqman
3
Oo, well, a coworker of mine suspected it was, and I just trusted him. Now I'm not so sure. I can tell you exactly where the file came from. It is the template file used by SAM on HPUX systems to store all the information when a template is created in the Users and Groups area of SAM.

I'm basically scripting my own user creation process, and was hoping to use SAM's templates to apply to the users created by my script. Now, if it's not perl, what could it be? It's system generated by SAM, and updated any time you create a new template in SAM. So it can't be anything too funky. And it can't be shell script, because you can't have spaces before or after the equal sign when assigning variables in shell script, correct?

Thanks for the reply.
Jul 23 '07 #3
miller
1,089 Expert 1GB
Splitting new question from previously completed thread.

- MODERATOR
Jul 23 '07 #4
KevinADC
4,059 Expert 2GB
Sorry mate, I don't even know what SAM is.
Jul 23 '07 #5
paqman
3
That's alright, I didn't think I was going to have to get HPUX specific, but looks like I might have to. I'll go post a thread over at the threads in unix.com. Thanks!
Jul 23 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: google_nospam | last post by:
Thanks in advance for any help. I'm looking for a way to pass data from php to perl. Basically, I want to take some dynamic data from a database, mixed with user input, then reformat it to make a...
1
by: Romuald Favre | last post by:
Hi there, I just installed Perl (v. 5.6.1. built for MSWin32 from ActiveState) on a new server Windows 2000. Amazingly the passing of arguments doesn't work ! I saved the following code in a...
1
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING...
26
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
4
by: asearle | last post by:
Hi everyone, I have a perl script that opens an Access mdb thus: system("C:\\Documents\ and\ Settings\\asearle\\My\ Documents\\iwh_dev\\MyAccessDB.mdb"); This works absolutely fine and,...
4
pawanrpandey
by: pawanrpandey | last post by:
How to pass parameter to a perl file (say myperl.pl) from a shell file (say work.sh ) ? and how to get that parameter in perl file ? { is using my $var = @_ }. Thanks, Pawan Kumar
0
by: Xah Lee | last post by:
In this article, i explain how the use of bit masks is a hack in many imperative languages. Often, a function will need to take many True/False parameters. For example, suppose i have a function...
8
by: jayakumarrt | last post by:
Dear Friends, I have a perl script abc.pl.I will be running this script with an parameter .The same parameter value i would like to pass to the shell script (The shell script is inside perl...
3
by: ajaymohank | last post by:
hello everyone..... i am ajay and i am new to php. in my project i have an option to invoke a bat file by passing parrameters and to diplay the result. i tried this code but my page got hung or...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.