learn powershell scripting

Read about learn powershell scripting, The latest news, videos, and discussion topics about learn powershell scripting from alibabacloud.com

Basic practice of Shell scripting----Learn a little bit every day

1, #!/bin/shThe first line tells the operating system that the interpreter for this script is/bin/sh this executable file2. While loop:#!/bin/shSleep 1; echo "User"; \Sleep 1; echo "Password"; \While true; Do \echo "Output"Sleep 1; \Done3, the shell script realizes the automatic input of Telnet, implements with the pipeline, the last while loop is used to give the last command full execution time(Sleep 1; echo "user"; \Sleep 1; echo "Password"; \Sleep 1; echo "Cd/usr/local"; \Sleep 1; echo "./te

Shell scripting learn to summarize the differences between--break and continue

Break is to jump out of the current loop, and continue is to jump out of the loop and start the new loop again[Email protected] test]#CatDemo.SH #/bin/Bash while true; DoRead-P"Please input number:"x yif((x>9)); ThenContinueelif((y>9)); Then BreakElseZ=$ ((x+y))Echo$zfi DoneEcho "Execution completed!"[email protected] test]#SHDemo.SHPlease input number:1 23Please input number:Ten 2 # $x >9, when the back part of the secondary loop is not executing, and the loop starts againPlease input number

BAT scripting Learn -6:oracle automatic backup restore script

;nulGoto Exit))Setjob_tmr=!bak_hou!:0 0if!bak_hou! LSS 10Setjob_tmr=0!bak_hou!:0 0At !job_tmr!/every:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31%windir%\ Oracleautobackup\oracleautobackup.bat-Backup>nul 2>nul for/F "USEBACKQ"%%i in ('dir%windir%\tasks\at*.job/b/o:d`) Do Setlastat=%%idel%windir%\tasks\oracle automatic backup. Job >nul 2>nulRename%windir%\tasks\!lastat! Oracle automatic Backup.Job::Save configuration file: SaveconfigEcho!bak_hou!>%configfile

Shell scripting Learn (2) compare two digit sizes

Tags: meaning cond centos7 test cat size pre BER syntax errorNote: The comparison string in the shell can only be used = =, Compare numbers using-eq,-ne,-gt,-ge,-lt,-le, or = =, [[Email protected]SH]$CatNumber_compare.SH #!/bin/bash# script Name: Number_compare.SH#用途: Compare two digit sizesEcho "Please input first number :"Read xEcho "You first number x= $x"Read-P"Please input second number:"yEcho "You second number y= $y"if[$x-eq $y]; Then Echo "Equal"elif[$x-gt $y]; Then Echo "x great

Linux Scripting Learn A

Linux Scripting Learning D: Delete rows that match the criteria Sed ' 1,2d '/etc/fstab delete 1, 2 lines, show other rows P: The line that displays the print fit condition Sed '/^\//p '/etc/fstab matches the display, plus the original, there will be 2 duplicateSed-n '/^\//p/etc/fstab displays the line that matches the print A: Add/string after the specified line Sed '/^\//a \ #hello world '/etc/fstab \ #

The basics before you learn shell scripting

seconds, in the shell script of the usual term loop.At this point, you press CTRL +z to pause it, and then enter BG to go back into the background.In the case of multitasking, if you want to move the task to the foreground, FG is followed by the task number and the task number can be obtained using the jobs command.9. >>, 2>, 2>> : The above-mentioned directional symbols > and >> denote the meaning of substitution and addition, then there are two symbols which are 2> and 2>> here. Indicate erro

BAT scripting Learn -4:oracle automatic backup restore script

"; REMif the object in the first parenthesis is a file name, enclose it in double quotes . REMTokens=1-3 "for the 1 to 3 columns, behind the suspect is%%a, how can it be%%b?" for/F "Usebackq delims==. Tokens=1-3 "%%a in ('SetOra[%%i] ') Do SetOra_cur=%%bSetora[%%i]=REM\ \ means escaped/ Echo!ora_cur!| Findstr "\" >nul 2>nul Echo!ora_cur!| Findstr "@" >nul 2>nul (Set/A J+=1SetOra[!j!] =!ora_cur! ) ) ) Wrote a lot of notes in order to understand Bat

Total Pages: 2 1 2 Go to: Go

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.