码迷,mamicode.com
首页 >  
搜索关键字:Shell printf    ( 43065个结果
shell编程实现创建新用户和打包文件
shell编程实现创建新用户和打包文件 1、shell编程创建新用户 #! /bin/bash `useradd $1` `echo $2 | passwd --stdin $1` 假设这个文件的名称为test.sh,则操作方式为: ./test.sh admin 123456 其中1参为用户名,2 ...
分类:系统相关   时间:2021-03-31 12:11:52    阅读次数:0
linux shell命令之REPLY
vi readreply.sh #!/bin/bash#第一部分 echo -n "What is your name?"readecho "Your name is $REPLY" #已将变量的值从标准输入读到REPLY #第二部分echo -n "What is the name of your ...
分类:系统相关   时间:2021-03-30 13:53:42    阅读次数:0
shell misc
. shell逻辑表达式 #!/bin/bash FILE_BASED_ENCRYPTION="true" if [ "$FILE_BASED_ENCRYPTION" == "true" ]then echo "if: first one" || echo "if: second one"else ...
分类:系统相关   时间:2021-03-30 13:52:37    阅读次数:0
Shell脚本基础
Shell脚本基础 变量 什么是变量? 变量即可以变化的量 变量名称注意事项 只能包含字母、数字、下划线,并且不能以数字开头 不应该跟系统中已有的环境变量重名,尽量不要全部使用大写,尽量不要用“_”下划线开头 最好做到见名知义 不能使用程序中的保留字,例如if、for等 变量类型 字符型 数值型 整 ...
分类:系统相关   时间:2021-03-30 13:46:50    阅读次数:0
Shell函数
Shell函数 linux shell 可以用户定义函数,然后在shell脚本中可以随便调用。 shell中函数的定义格式如下: [ function ] funname [()] { action; [return int;] } 说明: 1、可以带function fun() 定义,也可以直接f ...
分类:系统相关   时间:2021-03-30 13:46:15    阅读次数:0
如何看待malloc产生内存碎片
上代码直接研究: int main() { int *heap_d; int *heap_e; int *heap_f; heap_d = (int *)malloc(10); heap_e = (int *)malloc(10); printf("The d address is %p\n",he ...
分类:其他好文   时间:2021-03-30 13:44:13    阅读次数:0
uiautomator2结合python的一些操作
1 import os 2 3 # 获取手机系统信息 4 phone_sys = os.popen('adb shell "cat /system/build.prop | grep "product""').read() 5 print(phone_sys) 6 7 # 获取手机设备型号 8 de ...
分类:编程语言   时间:2021-03-30 13:42:38    阅读次数:0
实验2 c语言中的表达式及输入输出函数编程应用
任务一 #include <stdio.h> int main() { int num; scanf("%d",&num); printf("2049%04d\n",num); scanf("%d",&num); printf("2049%04d\n",num); scanf("%d",&num); ...
分类:编程语言   时间:2021-03-30 13:15:41    阅读次数:0
素数筛的算法感悟
前言: 对于一个数是否为素数的求解,我相信大家并不陌生。我们都知道素数的定义是如果某一个数除了1和它本身外,没有其他的因子了,那么我们就可以判定该数为素数。大家初学时求解并列举素数时写的代码一般是下面这个样子的,该函数的时间复杂度为O(N); 代码一: #include<stdio.h> int p ...
分类:编程语言   时间:2021-03-30 13:12:17    阅读次数:0
递归与非递归(栈实现)实现汉诺塔问题
#include<stdlib.h> #include<stdio.h> void Move(char now, int a, char next) { printf("%d:%c->%c\n", a, now, next); } void Hanoi(int n, char x, char y, ...
分类:其他好文   时间:2021-03-30 13:06:36    阅读次数:0
43065条   上一页 1 ... 27 28 29 30 31 ... 4307 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!