编程岁月

软件开发技术心得+笔记

How do I grab an INI value within a shell script?

I have a parameters.ini file, such as: [parameters.ini]     database_user    = user     database_version = 20110611142248 I want to read in and u...

2014-05-10 14:32:49

阅读数:469

评论数:0

How to start weblogic managed servers without manually entering the password

While starting a managed server in weblogic, we start with below command.     1 /bin/startManagedWebLogic.sh soa_server1 t3://localhost:7001 ...

2014-05-10 14:30:33

阅读数:636

评论数:0

-bash: ./my_script: /bin/bash^M: bad interpreter: No such file or directory

26down voteaccepted   I have seen this issue when creating scripts in Windows env and then porting over to run on a unix environment. Try running...

2014-05-10 14:27:46

阅读数:590

评论数:0

bash split string into array

In a bash script I would like to split a line into pieces and put them into an array. The line: Paris, France, Europe I would like to have them in...

2014-05-10 14:25:52

阅读数:1134

评论数:0

How to check the first character in a string in unix

Many ways to do this. You could use wildcards in double brackets: str="/some/directory/file" if [[ $str == /* ]]; then echo 1; else ech...

2014-05-10 14:22:50

阅读数:635

评论数:0

Linux Bash script to remove files older than 3 days

Can someone help me with a bash script to remove files older than 3 days in directory /u1/database/prod/arch?

2014-05-10 14:10:40

阅读数:558

评论数:0

Oracle Weblogic nodemanager STOP script Bash and Python

Everyone who is using Oracle Weblogic must had a thought like  “Where the *** is the stop script to kill my nodemanager proces”…. Well, i did. So i w...

2014-05-10 14:07:44

阅读数:639

评论数:0

Linux Grep OR, Grep AND, Grep NOT Operator Examples

Question: Can you explain how to use OR, AND and NOT operators in Unix grep command with some examples?   Answer: In grep, we have options equivale...

2014-05-10 14:05:59

阅读数:749

评论数:0

Start and Stop Oracle Weblogic NodeManager Via Shell Alias

Start and Stop Oracle Weblogic NodeManager via Shell Alias  This tip is to create two simple bash shell environment alias for starting and stoping W...

2014-05-10 14:03:26

阅读数:513

评论数:0

How do I determine if a web page exists with shell scripting?

Under a *NIX, you can use curl to issue a simple HEAD request (HEAD only asks for the headers, not the page body): curl --head http://myurl/ Then...

2014-05-10 14:01:39

阅读数:434

评论数:0

Listing only directory using ls in bash

This command lists directory in the current path: ls -d */ What exactly the pattern */ does? And how can we give absolute path in the above command...

2014-05-10 13:58:32

阅读数:528

评论数:0

【转】linux shell -- 块注释

使用#可以注掉一行脚本,但shell没有提供类似c语言/* */的成块注释符。所以shell中的块注释只能通过一些技巧实现。 1. 使用here document : 语句块 block 这里的block是标识符,可以自定义。注意不要与语句块中的字符产生冲突。 解释: 最前面的:表示...

2014-05-06 18:47:34

阅读数:662

评论数:0

在Linux中用source,dot(.)和直接用脚本文件名执行shell脚本的区别 .

用source,dot(.)的方式执行shell脚本的时候,不产生子进程,shell脚本在当前的shell中运行,shell脚本运行完成后,在shell脚本中声明的变量在当前的shell中是可见的. 直接用脚本文件名的方式执行shell脚本的时候,产生子进程,shell脚本在子进程中运行,she...

2014-05-06 18:45:19

阅读数:615

评论数:0

[转]linux shell 获取当前正在执行脚本的绝对路径

原文链接:http://sexywp.com/bash-how-to-get-the-basepath-of-current-running-script.htm   常见的一种误区,是使用 pwd 命令,该命令的作用是“print name of current/working direct...

2014-05-06 18:41:16

阅读数:545

评论数:0

正则表达式匹配任意字符(包括换行符)的写法

在正则中,匹配任意字符,其实写法网上有很多,但因为各种软件或程序写法不支持等原因导致的问题,大家可以多研究。 今天在Java中想使用正则表达式来获取一段文本中的任意字符。于是很随意得就写出如下匹配规则: (.*) 结果运行之后才发现,无法获得换行之后的文本。于是查了一下手...

2014-04-18 18:22:47

阅读数:618

评论数:0

Linux Shell - Trying to split a string into two variables

I'm trying to split a string into two variables (without having to use a while loop): var="hello:world" IFS=':' read var1 var2 echo &qu...

2014-04-18 18:06:00

阅读数:552

评论数:0

How to read a file line by line?

BR March 2014     1.Example 1.Tips 2.Bonus 2.Initiate a Loop 3.See also: While read LINE   This article introduces the concept of playin...

2014-04-18 17:56:41

阅读数:600

评论数:0

用Windows命令行如何检查Windows系统补丁(KBxxxxxx)的最后一次安装时间?

在打开的DOS命令窗口中,输入以下命令: wmic qfe list full /format:htable >C:\Temp\hotfixes.htm  这个命令会创建一个已安装微软补丁包的HTML列表。 直接命令行输出:wmic qfe list full       ...

2013-01-16 12:37:31

阅读数:831

评论数:0

获得目录文件数和剩余容量的dos命令

@echo off for /f %%i in ('dir /s *.*^|find /i "个文件"') do set num=%%i echo. echo 文件数量统计结果: echo. echo D:\movie目录下有 %num% 个文件 ech...

2012-07-04 19:09:00

阅读数:1180

评论数:0

如何用DOS命令,获取一个目录下的文件数目

发信人: GOOGOODALLS (我爱Figo), 信区: DOS 标  题: 如何用DOS命令,获取一个目录下的文件数目? 发信站: 水木社区 (Fri Mar  9 08:40:01 2007), 站内 如何用DOS命令,获取一个目录下的文件数目,并写入文件? 因为自己编译脚本,...

2012-07-04 17:05:35

阅读数:829

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭