摘要: 在 linux 中,这些重定向都是等价的$ file command arg1 arg2 arg3 $ command > file arg1 arg2 arg3 $ command arg1 > file arg2 arg3 $ command arg1 arg2 > file arg3 $ co... 阅读全文
posted @ 2015-04-11 17:36 lian4187 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 假若目前有一个windows下拷贝过来的文件 favorite_songs(喜欢的歌曲单,内部是 CRLF 结尾的),现在还有一个文件 music_list(内部包含所有歌曲的路径,非 CRLF 结尾),现在想将所有的 favorite songs 拷贝到一个单独的 favorite_dir 目录。... 阅读全文
posted @ 2014-06-20 19:40 lian4187 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 原创地址为:https://github.com/mydzor/bash2048#!/usr/bin/env bash#important variablesdeclare -ia board # array that keeps track of game statusdeclare -i pieces # number of pieces present on boarddeclare -i flag_skip # flag that prevents doing more than one operation on # single f... 阅读全文
posted @ 2014-03-26 10:03 lian4187 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 工作需要,写了备份和恢复文件的脚本:conf 文件:要备份和恢复的文件列表,支持正则,以 # 开头的为注释bak.sh 文件:读取 conf 文件,并备份所有文件到当前目录的 files 目录中(需要更改你自己的 $HOME 目录,如果需要,更改你喜欢的拷贝命令,默认 rsync)restore.sh 文件:读取 conf 文件,并将 files 目录中的文件按 conf 文件恢复(需要更改你自己的 $HOME 目录,如果需要,更改你喜欢的拷贝命令,默认 rsync)所有文件已经上传至百度云:http://pan.baidu.com/s/1gdECx95bak.sh 1 #!/bin/sh 2 阅读全文
posted @ 2014-03-20 16:20 lian4187 阅读(537) 评论(1) 推荐(0) 编辑
摘要: 在基于MISP(loongson)架构处理器与基于 x86 架构处理器的 linux 内核中添加系统调用时更改的文件是不同的,x86 中需要更改 arch/x86/kernel/syscall_table_32.S arch/x86/include/asm/unistd_32.h文件。而在 MIPS 中分两种情况,32bit 的内核中,需要更改 arch/mips/kernel/scall32-o32.S arch/mips/include/unistd.h两个文件;在 64bit 内核中,需要修改 arch/mips/kernel/scall64-64.S ... 阅读全文
posted @ 2014-03-20 15:01 lian4187 阅读(1117) 评论(0) 推荐(0) 编辑