小编abu*_*ker的帖子

如何重定向"time"命令的输出?

我试图重定向时间命令的输出,但我不能:

$time ls > filename
real    0m0.000s
user    0m0.000s
sys     0m0.000s
Run Code Online (Sandbox Code Playgroud)

在文件中,我可以看到ls命令的输出,而不是time.请解释一下,为什么我不能以及如何做到这一点.

unix shell time io-redirection

89
推荐指数
6
解决办法
5万
查看次数

我想使用不同的架构还原数据库

temp1使用follwing命令转储了一个名为的数据库

$  pg_dump -i -h localhost  -U postgres -F c -b -v -f pub.backup temp1 
Run Code Online (Sandbox Code Playgroud)

现在我想在另一个名为"db_temp"的数据库中恢复转储,但是我只是希望所有表都应该在"temp_schema"(而不是fms temp1数据库中的默认模式)中创建"db_temp"数据库​​.

有没有办法用pg_restore命令做到这一点?

任何其他方法也不胜感激!

postgresql pg-dump pg-restore

55
推荐指数
4
解决办法
5万
查看次数

如何将字符串转换为浮点数?

#include<stdio.h>
#include<string.h>

int main() 
{
    char s[100] ="4.0800" ; 

    printf("float value : %4.8f\n" ,(float) atoll(s)); 
    return 0; 
}
Run Code Online (Sandbox Code Playgroud)

我希望输出应该是4.08000000我得到的4.00000000.

有没有办法得到点后的数字?

c floating-point type-conversion atof strtod

48
推荐指数
4
解决办法
17万
查看次数

当光标位于单词的中间时,如何删除单词?

当光标在Vim中位于该单词中间的某个位置(在结尾或单词的开头)时,如何删除单词?

vim

37
推荐指数
3
解决办法
9381
查看次数

为什么预处理器会占用空间?

我想用预处理器评论一行:

#define open /##*

#define close */

main()
{
        open commented line close
}
Run Code Online (Sandbox Code Playgroud)

当我做$gcc -E filename.c我想到的

/* commented line */ 
Run Code Online (Sandbox Code Playgroud)

但我明白了

/ * commented line */ 
Run Code Online (Sandbox Code Playgroud)

这样编译器就会显示错误

为什么会给出不必要的空间?

stringification c-preprocessor

7
推荐指数
3
解决办法
213
查看次数

Crontab设置为18:00至09:00

我只是想设置一个crontab使用我想让程序在18:00到09:00之间每15分钟运行一次
我已经发出这个声明并等待但是我认为它不起作用

*/15 18-9 * * 1-6  Program_name
Run Code Online (Sandbox Code Playgroud)

任何建议将不胜感激

unix crontab

7
推荐指数
1
解决办法
2162
查看次数

如何检查Perl的可用性,其版本和所需模块的存在?

我编写了一个Perl脚本,我只是想把它给每个人,因为我计划编写一个bash脚本,用于测试用户的环境并查找该环境是否能够运行Perl脚本.

我想测试一下这样的事情:

  1. Perl是否已安装在该系统中
  2. Perl应该有5或更高版本
  3. 模块JSON :: Any是否可用

任何建议都会非常感激:-)

bash perl perl-module

6
推荐指数
3
解决办法
2955
查看次数

如何在Perl中使用客户端和服务器传输哈希?

我只想从客户端向服务器传输(发送或接收)哈希.

你能告诉我在Perl中哪种方式更好吗?或者你能推荐任何CPAN模块吗?

sockets perl serialization cpan

5
推荐指数
1
解决办法
204
查看次数

在debian lenny中安装postgres 9.0

亲爱的,
我的系统有以下分发细节

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 5.0 (lenny)
Release:    5.0
Codename:   lenny
Run Code Online (Sandbox Code Playgroud)

我需要在这台机器上安装postgres 9.0,但我找不到postgres 9.0的任何稳定的lenny包,有没有其他方法可以做
任何建议将不胜感激!

postgresql debian

5
推荐指数
1
解决办法
1万
查看次数

宏观上的困惑

以下代码工作正常

#define open {
#define close }
#include<stdio.h>
#define int char

 main()
 open
 int a ;
 printf("This is testing code" );
 close
Run Code Online (Sandbox Code Playgroud)

但如果我交换线路

#include<stdio.h>
#define int char 
Run Code Online (Sandbox Code Playgroud)

#define int char 
#include<stdio.h> 
Run Code Online (Sandbox Code Playgroud)

它会抛出很多像这样的错误

In file included from /usr/include/stdio.h:36,
                 from print.c:19:
/usr/include/bits/types.h:35: error: both 'short' and 'char' in declaration specifiers
/usr/include/bits/types.h:37: error: both 'long' and 'char' in declaration specifiers
/usr/include/bits/types.h:42: error: both 'short' and 'char' in declaration specifiers
/usr/include/bits/types.h:43: error: both 'short' and 'char' in declaration specifiers
.................................................
so and so …
Run Code Online (Sandbox Code Playgroud)

c c-preprocessor

2
推荐指数
2
解决办法
336
查看次数

postgres :创建一个像 0000001 到 00000n 这样的序列

亲爱的所有人,
我想在 postgres 中创建一个序列,它类似于 0000000001 到 00nnnnnnnnn 通常我们可以从 1 到 n 创建,但我希望在前面加上 0
有没有什么简单的方法可以做到这一点???

postgresql

1
推荐指数
1
解决办法
2408
查看次数

点网的开源替代方案

可能重复:
.net开源和运行平台选择

任何人都可以告诉我哪个是.NET的完美开源替代品.

.net open-source

0
推荐指数
1
解决办法
2477
查看次数

当我创建超过4,000个数据库连接时,为什么Perl会使系统变得非常慢?

我正在编写代码以使用Perl脚本查找数据库的速度.

我的意图是在每个fork(它将充当4,000个不同的客户端)之后建立一个4,000数据库连接并休眠,当我收到信号时我发出更新命令,但系统本身变得非常慢并且几乎挂起以进行连接本身,甚至我无法使用我的终端发送信号.

我正在使用DBI模块,我的系统中有4GB RAM,其中Postgres 8.3在不同的机器上运行.

postgresql perl

-1
推荐指数
1
解决办法
371
查看次数