当前位置: 首页 > news >正文

求南浦做电商网站微信里我的微站是怎么弄的

求南浦做电商网站,微信里我的微站是怎么弄的,h5个人网站模板,做图片模板目录 Linux Shell 数据类型 变量类型 运算符 算术运算符 赋值运算符 拼接运算符 比较运算符 关系运算符 控制结构 顺序结构 条件分支结构 if 条件语句 case 分支语句 循环结构 for 循环 while 循环 until 循环 break 语句 continue语句 函数 函数定义 … 目录 Linux Shell 数据类型 变量类型 运算符 算术运算符 赋值运算符 拼接运算符 比较运算符 关系运算符 控制结构 顺序结构 条件分支结构 if 条件语句 case 分支语句  循环结构 for 循环 while 循环 until 循环 break 语句 continue语句 函数 函数定义  函数名 函数体 返回值 参数 函数的局部性 简单函数示例 函数的递归 实例操作 数组遍历操作 九九乘法表 基本上每一门编程语言都能从数据类型、变量、运算符、控制结构、函数五个方面着手初步掌握这些内容就可以快速入门为一名初级程序员。 Linux Shell Shell是Linux命令行解释器主要用于执行操作系统命令和脚本。Linux Shell编程语言是一种用于与操作系统内核进行交互的命令行脚本语言属于解释型、弱类型的动态语言。 数据类型 bool、数字、字符串、数组 变量类型 环境变量、用户变量、全局变量、只读变量 set let export readonly  env 运算符 算术运算符 - * / % 赋值运算符 没有、-、*、/这类复合赋值 拼接运算符 只能用于字符串的拼接 比较运算符 、! 关系运算符 -eq    检测两个数是否相等相等返回 true。 -ne    检测两个数是否不相等不相等返回 true。 -gt    检测左边的数是否大于右边的如果是则返回 true。 -lt    检测左边的数是否小于右边的如果是则返回 true。 -ge    检测左边的数是否大于等于右边的如果是则返回 true。 -le    检测左边的数是否小于等于右边的如果是则返回 true。 控制结构 顺序结构 顺序结构是最简单的算法结构语句与语句之间是按从上到下的顺序进行的它是由若干个依次执行的处理步骤组成的。 注同一行可以有多个语句只要用分号“;”来分隔即可。 条件分支结构 if 条件语句 可以细分为 if , if-else , if-elif-else 多种形式 hannHannYang:~$ help -m if NAMEif - Execute commands based on conditional.SYNOPSISif COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fiDESCRIPTIONExecute commands based on conditional.The if COMMANDS list is executed. If its exit status is zero, then thethen COMMANDS list is executed. Otherwise, each elif COMMANDS list isexecuted in turn, and if its exit status is zero, the correspondingthen COMMANDS list is executed and the if command completes. Otherwise,the else COMMANDS list is executed, if present. The exit status of theentire construct is the exit status of the last command executed, or zeroif no condition tested true.Exit Status:Returns the status of the last command executed....... case 分支语句  hannHannYang:~$ help -m case NAMEcase - Execute commands based on pattern matching.SYNOPSIScase WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esacDESCRIPTIONExecute commands based on pattern matching.Selectively execute COMMANDS based upon WORD matching PATTERN. The| is used to separate multiple patterns.Exit Status:Returns the status of the last command executed.......循环结构 for 循环 hannHannYang:~$ help -m for NAMEfor - Execute commands for each member in a list.SYNOPSISfor NAME [in WORDS ... ] ; do COMMANDS; doneDESCRIPTIONExecute commands for each member in a list.The for loop executes a sequence of commands for each member in alist of items. If in WORDS ...; is not present, then in $ isassumed. For each element in WORDS, NAME is set to that element, andthe COMMANDS are executed.Exit Status:Returns the status of the last command executed.......while 循环 hannHannYang:~$ help -m while NAMEwhile - Execute commands as long as a test succeeds.SYNOPSISwhile COMMANDS; do COMMANDS; doneDESCRIPTIONExecute commands as long as a test succeeds.Expand and execute COMMANDS as long as the final command in thewhile COMMANDS has an exit status of zero.Exit Status:Returns the status of the last command executed....... until 循环 hannHannYang:~$ help -m until NAMEuntil - Execute commands as long as a test does not succeed.SYNOPSISuntil COMMANDS; do COMMANDS; doneDESCRIPTIONExecute commands as long as a test does not succeed.Expand and execute COMMANDS as long as the final command in theuntil COMMANDS has an exit status which is not zero.Exit Status:Returns the status of the last command executed.......break 语句 hannHannYang:~$ help -m break NAMEbreak - Exit for, while, or until loops.SYNOPSISbreak [n]DESCRIPTIONExit for, while, or until loops.Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosingloops.Exit Status:The exit status is 0 unless N is not greater than or equal to 1.......continue语句 hannHannYang:~$ help -m continue NAMEcontinue - Resume for, while, or until loops.SYNOPSIScontinue [n]DESCRIPTIONResume for, while, or until loops.Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.If N is specified, resumes the Nth enclosing loop.Exit Status:The exit status is 0 unless N is not greater than or equal to 1....... 两者的区别  break语句 break语句用于退出本层循环当执行到break会立即跳出当前循环执行后续代码。 在多层嵌套循环中break只会跳出最近的一层循环。 continue语句 continue语句用于结束本次循环跳过本次循环中剩余的代码直接进入下一次循环。 在多层嵌套循环中continue只会跳过最近的一层循环。 函数 hannHannYang:~$ help -m function NAMEfunction - Define shell function.SYNOPSISfunction name { COMMANDS ; } or name () { COMMANDS ; }DESCRIPTIONDefine shell function.Create a shell function named NAME. When invoked as a simple command,NAME runs COMMANDs in the calling shells context. When NAME is invoked,the arguments are passed to the function as $1...$n, and the functionsname is in $FUNCNAME.Exit Status:Returns success unless NAME is readonly. 函数定义  函数名 Shell函数用关键字 function 声明跟在后面的 name 即函数名。声明后就用函数名 [参数]来调用函数。function 非必须也能用函数名加一对括号 name() { ... } 来声明定义函数。 函数体 函数名后的 { Commands; } 即函数体是实现函数功能的主体。 返回值 Shell函数可以有一个返回值可以使用return语句返回一个值。返回值的范围是0到255之间0表示成功非零值表示错误。如果函数中没有return语句或者使用exit命令退出函数则函数的返回值为退出命令的返回值。 参数 Shell函数可以通过参数接收输入的值。在函数定义时可以在括号中指定参数列表。参数可以在函数体中使用也可以通过特殊变量$#获取函数的参数个数通过特殊变量$获取所有的参数。 函数的局部性 Shell函数的变量是局部的即在函数内部定义的变量只在该函数内部可见不会影响到函数外部的变量。如果要使用全局变量需要在函数外部定义。 简单函数示例 hannHannYang:~$ function add {num1$1num2$2sum$((num1 num2))echo The sum of $num1 and $num2 is $sum.} hannHannYang:~$ add 10 20 The sum of 10 and 20 is 30. 语句比较少的函数可以在一行内完成函数体中的语句间用分号“;”来分隔即可。 hannHannYang:~$ function sub { num1$1; num2$2; sum$((num1 - num2)); echo The difference between $num1 and $num2 is $sum.; } hannHannYang:~$ sub 30 20 The difference between 30 and 20 is 10. 函数的递归 Shell函数可以递归调用自身这在处理嵌套数据结构或递归算法时非常有用。需要注意的是递归调用可能会导致栈溢出或效率低下的问题因此在使用时需要谨慎。 示例阶乘函数 hannHannYang:~$ factorial() {if [ $1 -le 1 ]thenecho 1elseecho $(( $1 * $(factorial $(( $1 - 1 ))) )) i } fi} hannHannYang:~$ read -p 请输入一个整数 num 请输入一个整数6 hannHannYang:~$ result$(factorial $num) hannHannYang:~$ echo $num 的阶乘为 $result 6 的阶乘为 720 实例操作 数组遍历操作 hannHannYang:~$ for i in 1 2 3 4 5; do echo -n $i; done; echo 12345 hannHannYang:~$ for i in {1..5}; do echo -n $i; done; echo 12345 hannHannYang:~$ sum0;for i in {1..100};do let sumi;done;echo $sum 5050 hannHannYang:~$ for i in {1..5}{8..10}; do echo -n $i; done; echo 18191102829210383931048494105859510 hannHannYang:~$ for i in {1..5}{8..10}; do echo -n $i ; done; echo 18 19 110 28 29 210 38 39 310 48 49 410 58 59 510 hannHannYang:~$ for i in {A..C}{a..d}; do echo -n $i ; done; echo Aa Ab Ac Ad Ba Bb Bc Bd Ca Cb Cc Cd 九九乘法表 hannHannYang:~$ cat 99mul.sh #!/bin/bashfor i in {1..9} dofor j in {1..9}doif [ $j -le $i ]thenecho -n $j*$i$(($i*$j)) fidoneecho done hannHannYang:~$ bash 99mul.sh 1*11 1*22 2*24 1*33 2*36 3*39 1*44 2*48 3*412 4*416 1*55 2*510 3*515 4*520 5*525 1*66 2*612 3*618 4*624 5*630 6*636 1*77 2*714 3*721 4*728 5*735 6*742 7*749 1*88 2*816 3*824 4*832 5*840 6*848 7*856 8*864 1*99 2*918 3*927 4*936 5*945 6*954 7*963 8*972 9*981 hannHannYang:~$ cat 99mul.sh #!/bin/bashfor i in {1..9} dofor j in {1..9}doif [ $j -le $i ]thenprintf %d*%d%2d $j $i $(($i*$j))fidoneecho done hannHannYang:~$ bash 99mul.sh 1*1 1 1*2 2 2*2 4 1*3 3 2*3 6 3*3 9 1*4 4 2*4 8 3*412 4*416 1*5 5 2*510 3*515 4*520 5*525 1*6 6 2*612 3*618 4*624 5*630 6*636 1*7 7 2*714 3*721 4*728 5*735 6*742 7*749 1*8 8 2*816 3*824 4*832 5*840 6*848 7*856 8*864 1*9 9 2*918 3*927 4*936 5*945 6*954 7*963 8*972 9*981 hannHannYang:~$ cat 99mul.sh  #!/bin/bashfor i in {1..9} dofor j in {1..9}doif [ $j -le $i ]thenif [ $j -eq 1 ]thenprintf %d*%d%d $j $i $(($i*$j))elseprintf %d*%d%2d $j $i $(($i*$j))fifidoneecho done hannHannYang:~$ bash 99mul.sh 1*11 1*22 2*2 4 1*33 2*3 6 3*3 9 1*44 2*4 8 3*412 4*416 1*55 2*510 3*515 4*520 5*525 1*66 2*612 3*618 4*624 5*630 6*636 1*77 2*714 3*721 4*728 5*735 6*742 7*749 1*88 2*816 3*824 4*832 5*840 6*848 7*856 8*864 1*99 2*918 3*927 4*936 5*945 6*954 7*963 8*972 9*981 本文简单提一下Linux Shell编程语言的入门要点之后再对各个环节进行分类详细举例说明。
http://www.w-s-a.com/news/553764/

相关文章:

  • 新余网站设计seo自学网站
  • 新乡个人网站建设价格wordpress数据插件
  • 你是网站设计有限公司的项目经理网站推广的重要性
  • 网站定制开发怎么写泸州设计公司有哪些
  • 上海网站建设zj kt迅速编程做网站
  • 郑州服装 网站建设网站栏目合理性
  • 平面设计在线网站最新汽油价格调整最新消息
  • 刷单网站建设wordpress缩略图 裁剪
  • 视差 网站泰州公司做网站
  • 广州网站优化系统怎么做淘客网站
  • 类似凡科互动的网站wordpress网站下载
  • 临沂网站制作公司安卓app开发实例教程
  • 泰州做网站 泰公网络科技公司网站升级中html
  • 如何做授权网站网站设计心得
  • 网站排名快速上升wordpress自动标签页
  • 做的好的手机网站有哪些万网域名交易
  • 网站怎么做漂亮点做陶瓷的公司网站
  • 软件开发设计制作网站下载自己怎么做视频收费网站
  • 江苏省建设安全协会网站天津网站建设哪家公司好
  • 资源类网站怎么做的网站上线准备工作
  • 长沙专业网站建设怎么做企业建站公司服务
  • 肇庆市有限公司网站建设手机直接看的网站有哪些
  • 织梦修改网站后备份英语作文模板高中
  • 个人网站域名用什么好上海公司拍沪牌需要什么条件
  • 网站建设 保密做网站赚钱交税
  • 食品建设网站前的市场分析进出口网站贸易平台有哪些
  • php商城网站建设个人网站用什么服务器
  • 如何做好品牌网站建设方案网站开发的学习
  • 网站开发 管理方案wordpress怎么搭建微博
  • 有哪些ui的设计网站网上商城网站建设设计方案