a.sh[code]#!/bin/bash function aa() { echo "aa" } echo "bb" [/code]如果b.sh写成[code]#!/bin/bash source a.sh [/code]这样就会输出: aa bb 现在只想输出aa,不想输出bb需要怎么做?
▲vb不能直接调用Win API,要先声名然后在调用。 ▲ 声明 API 过程 ,比如声名SetWindowTextA 首先,在模块的声明部分对过程进行声明: Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long 过程的精确语法定义可以用 API Viewer 应用程序找到,在 Win32api.txt 文件中也可以找到它。如果将 Declare 放在 Form 或者 Class 模块内,那么...
[hadoop1@node1 myshell]$ more readconfig.sh #!/bin/bash configfile=/home/hadoop1/myshell/config/config.ini function gethost() { host=`sed '/^host=/!d;s/.*=//' $configfile` echo $host } 这个脚本里有一个函数gethost,我想在另外一个shell调用该函数获取ip,请问大家如何调用?
比如下面的shell脚本文件: #===========test.sh: #! /bin/sh echo_line() { echo date echo "Wellcome to shell func!" } echo_hello() { echo "Hello World!" } #====================== 怎么在shell下调用以上两个函数啊? 为什么我用【./test.sh echo_hello】却什么也没有输出? 当然,我已经给test.sh加了可执行权限了。