name.js – This is our script file, which we created. The code of javascript is written inside devops.js. In which DevOps is the file name, .js is the extension. Javascript has an extension of .js
Type – This is also an attribute of the script tag, it tells the browser that it is javascript. Now it is not necessary to write it, you can leave it if you want.
Text/javascript – It defines what type these documents are.
document.write(“Hello World”); – This is a function which is displaying the data.
</script> – Closing Script tag.
How to link more than one External?
You can link more than one JavaScript file to a single document. Just need to write different script tags for that.
This function is used to write arbitrary HTML and content into the page. If we use this function after an HTML document is fully loaded, will delete all existing HTML. It is used only for testing purposes.
Ex:- document.write("Hello world");
document.write(variable);
document.write(4+2);
document.write("hello world . <br>");
document.write("hello world . <br>" + variable +"<br>");
Alert function in JavaScript
The data that will be displayed in it will be in the dialog box. You forcefully want to see this thing, then only this work will be done. In that case, you use a window. alert
An identifier is a name having a few letters, numbers, and special characters _(underscore). It is used to identify a variable, function, symbolic constants, and so on.
Ex:- X2 PI Sigma Matadd
Veriable in JavaScript
Variable can be any name, in which a combination of letters, numbers, and special characters can be written _()(underscore) and $(dollar). It is not necessary that there should be only a combination, it can only be a letter.
Ex:- c, fact, b33, total_amount ect.
Rules of Veriable in JavaScript
Variable can contain a combination of letters, digits, _()(underscore), and dollar signs($).
Must begin with a letter A-Z or a-z or underscore or dollar sign.
A Jenkins Admin can execute groovy scripts remotely by sending an HTTP POST request to /script/ url or /scriptText/.
curl example via bash
curl -d "script=<your_script_here>" https://jenkins/script
# or to get output as a plain text result (no HTML)
curl -d "script=<your_script_here>" https://jenkins/scriptText
vijayakumar.cm created the topic: Expect script for Windows
Hi,
I’m executing one expect script from windows to do automatic FTP to Unix server.
Error msg:-
D:\expect>tclsh85 telnet.exp
Connecting to 10.118.215.14 to upload the latest build.
invalid command name “spawn”
while executing
“spawn ftp $hostname”
(file “telnet.exp” line 17)
do anyone have any idea about this error/expect script for windows?
processing input file […NetBeansProjects/Tetris3/build/metadata.emma] …
loaded 25 metadata entries
1 file(s) read and merged in 5 ms
nothing to do: no runtime coverage data found in any of the data files
it won’t work
i have write
“Develop a function that accepts a string of names separated by comma (example given below), add those names in an array and display the names added in the array”
Example: rajani; Disha; Dhara; Hunny ;moon
without using split function
can i use mid function
rajani replied the topic: function in vb script
i am able to display name but with comma
Dim fruits()
ReDim fruits(100)
nofruits=0
‘we do not know how many fruit names we are going to enter and so, we have declared the array size as 100
For i=0 to 100
fruits(i)=inputbox(“Enter the name of a fruit separated by comma”)
ans = MsgBox(“Do you want to continue”, vbYesNo, “Confirm Continuation…”)
If ans=vbNo Then
Exit For
End If
nofruits=nofruits+1
Next
ReDim Preserve fruits(nofruits)
‘Redim keyword resets the number of elements that can be accommodated in the array.
fruitnames=””
For each fruit in fruits
‘Using For Each Next we have displayed all the names of the fruits which was entered and kept in fruits array.
‘For Each Next extracts the fruit names stored in the array and msgbox displays the output.
fruitnames=fruitnames&fruit&vbnewline
Next
msgbox fruitnames
rajani replied the topic: function in vb script
any suggestion
rajani replied the topic: function in vb script
dim Array, Str1,X
Str1 = “Neha; Swati; Disha; Sonya; Dhara”
Array = split(Str1,”;”)
for each x in Array
message = message & x & vbCRLF
next
msgbox message
rajeshkumar created the topic: How to read a .properties file through script
The easy way to do it is to note that a Java properties file has the same format as a basic shell script.
However, there’s a trick to it. If you just run the properties file like so:
sh appl.properties
The assignments will be made at the sub-level, then discarded when the properties file (script) ends execution.
So to get the properties in a calling script, you need to use the “source” command:
. appl.properties
Note that the space after the initial dot is very important!
To reference shell variable assignments, you use the “$” to indicate variable substitution.
So, to put it all together:
# #!/bin/sh
# # Sample shell script to read and act on properties
#
# # source the properties:
# . appl.properties
#
# # Then reference then:
# echo "My name is $name and I'm $age years old."
scmuser created the topic: tty terminals related script??
Develop script logic that allows only romeo and henry to execute a program, and only from the terminals tty05 and tty06