This article describes how to get the directory where the script file (. ps1 file) is located in the PowerShell script. This article describes the method applied to PowerShell 3.0.
In PowerShell 3.0, there is a variable that makes it easy to get the directory where the script resides. We are in E:\ps\script1.ps1 and SCRIPT2.PS1, the contents are as follows:
SCR
First, debug scripts
Debugging is one of the important features that every programming language should implement, and when something unexpected happens, use it to generate the running information of the script, and the debugging information can help you figure out what caused the program to crash or behave abnormally.Second, bash built-in debugging function
With the built-in debugging capabilities of bash, you can debug the entire
Slackware version: Slackware 7.0 and above
Slackware uses BSD-style init scripts, while many other distributions use System V-style init scripts. SysV and BSD scripts are all readable, that is, they are shell scripts, not compiled programs. The main difference is how the script is designed.
SysV scripts tend to accept parameters such as Start, stop, and restart, depending on the program it starts. So you can start bind with a command like/etc/init.d
What is a shell?The shell is a scripting language aming_linux blog.lishiming.netYou can use logical judgments, loops, and other syntaxFunctions can be custom-definedThe shell is a collection of system commandsShell scripts enable automated operations, which can greatly increase our operational efficiencyShell script structure and execution methodsNeed to add #!/bin/bash at the beginningLines that begin with # are interpreted as explanatory notesThe na
LoadRunner script writes script output log to external file, analysis parameter value methodCategory: Experience loadrunner my test 2012-04-01 12:52 2340 people read reviews (0) Favorites report Script Loadrunnerstreamfilestring Test, you cannot view the output log when you run the script in the controller, you can
Linux command line and shell script programming Daquan graphic desktop script programming create text menu create menu layout [plain] #! /Bin/bashclear # clear screen echo-e quot; \ t \ tMenu quot; echo-e quot; 1. \ tDisplaydiskspace quot; echo-e quot; Linux command line and shell script programming Daquan create text menu creation menu layout [plain] #! /Bi
IDC small rookie one, non-trained. There are often customers with CentOS servers that need to allocate 15 IPs or even 30 IPs. Each time a manual assignment was cumbersome, it took a day to learn the shell script and write the script.#!/bin/bashRead-p "The IP numbers:" numwhile [[$num-GT 0]]DoRead-p "Please enter IP address:" IPAddrTouch/etc/sysconfig/network-scripts/ifcfg-eth0: $numNcf=/etc/sysconfig/networ
This article mainly introduces 2 methods of referencing and invoking another script file in the shell script, this article introduces the syntax of the two methods, then gives the actual usages and some places to pay attention to, the friend who needs can refer to the following
In Java,python, you can use the import method to make calls between scripts or modules, for example:
The code is as follows:
>>>
2014-08-23 BaoxinjianI. Summary
A script that is circulated online to query the efficiency of a single SQL query and export it as an HTML report, similar in function to Dbms_profilerQuery sql_id by session, only run script, export as HTML reportThe SQL script: Http://files.cnblogs.com/eastsea/sqlcheck.zipIi. cases-Using the
the phyaddr.txt file, jump from the first line to the next line, that is, start from the third line, and set the value to the Mac variable, for example, physical address .........: 00-e0-fc-0c-a8-4f. Each continuous value is a symbol.Symbol 1: physicalSymbol 2: address.Symbol 3 :.Symbol 4 :.Symbol 5 :.Symbol 6 :.Symbol 7 :.Symbol 8 :.Symbol 9 :.Symbol 10 :.Symbol 11 ::Symbol-E0-FC-0C-A8-4FTokens = 12. Now you should understand it, but it is worth noting that the variables in the for command are
The Asia Pacific Network information is recorded here, updated every day.
Http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
The following script will edit this text, output several major network segments of the domestic operators.
Copy Code code as follows:
#!/bin/sh
#auto Get the IP Table
#get the newest Delegated-apnic-latest
RM delegated-apnic-latest
If Type wgetThen wget http://ftp.apnic.net/apnic/stats/apni
Background: Work on a variety of online machine landing scripts, and some need to log into the board before landing on the machine, and some dynamic password, each input is very troublesome, the use of automated landing scripts to manage too convenient but ~Principle: Shell call expect to log in remotelylogin.sh
#!/usr/bin/env bash
relay_name= "$relay _name"
relay_password= "$relay _password"
relay_host= "xxx"
Token=$1
echo Enter the corresponding number return. "
Select Server in" Server01
Use of sqlite3 script and sqlite3 script
I wanted to find a database-specific tool. Later I found that the script was very simple and I used the script directly.
The sqlite3 script allows you to conveniently view the content in the current database. It is actually very sim
Bash script skills-trap Command, bash script-trap
Share a shell script technique. When you write a shell script, you generally only ensure that the function is available, but the program is not very robust and not robust enough. Most of them are script processing.
The buil
Shell script structure Example 1, shell script example
Since 2013, I have been lazy and have written a lot less. This year, I plan to summarize my previous accumulated experience.
Start with shell.
After nearly three years of game O M, I often write some shell scripts during the period. Many scripts actually have many reusable parts.
According to your own style, if it is an important
In linux, when I use a php script to call another php script, only the ftp permission is available for the linux space ~~ Now I want to write a script first. php to regularly execute second. php and Execute second. php. I don't know how to write it ~~ First. phpignore_user_abort (TRUE); // use a php script to call anot
Implementation of PHP script under Linux, Linux executes PHP script
Entering commands in Linux
Copy the Code code as follows:Crontab-e
Then use the VIM command to edit the open file, enter
Copy the Code code as follows:0 * * * */usr/bin/php-f/home/userxxx/update.php
Save, exit, OK, now the system will automatically execute the update.php script at each 0 point,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.