topics

全部话题 - 话题: bash
首页 1 2 3 4 5 末页 (共10页)
i******t
发帖数: 22541
1
我是挺易的
我bash 孙悦 不好好努力
你可以翻看我之前的帖子
来这个版 大家都是放松的。不管bash 谁也好 没必要牵扯到个人。
最起码我还没到为了某个球员 去骂别人
最后加几句, 来这里是玩的 不是吵架的。
建议你不要那么容易激动
y*****2
发帖数: 2435
2
来自主题: E-Sports版 - BASH你太强了
真实ALL IN啊。为了表扬这位老客户长期支持本菠菜公司事业,本菠菜公司决定颁奖50
伪币,以资鼓励!请BASH大人上台领奖!
虽然BASH不是本公司最富有的客户,但是其长期购买的决心,以及ALL IN的魄力,都值得大家学习和效仿!
x****r
发帖数: 12
3
你如果有root password, 直接改/etc/passwd把/bin/csh换成/bin/bash。 如果没有
root也没有chsh, 在~/.login里加入一行:
exec bash -l
m*********g
发帖数: 273
4
来自主题: Linux版 - sed 和 bash script 求助
想实现以下功能:
file1:
NP 4
要改成:
NP 5
在终端下:
$ sed '/^NP/s/[0-9]/5/' file1
可以完成。
现在要写一个bash scirpt 批量做这件事
#!/bin/bash
for((n=1;n<=3;n++))
do
sed '/^NP/s/[0-9]/${n}/' file1 > file1.$n
done
这样不成功, file1.1 是这样的
NP ${n}
怎样才能吧$n实际的值传给script中的sed呢?
我知道用perl可以做的,只是想用一下sed这个简单工具,先谢了
g****g
发帖数: 1828
5
来自主题: Linux版 - bash script真难看懂
这个我都快读晕了。
#!/bin/bash
# Light weight option parser for bash
#
abstract=""
usage="Usage: \${0##*/} [options] [arg1] [arg2] ..."
function Abstract()
{
abstract=$@
}
function Usage()
{
usage=$@
}
function Option()
{
eval "options=\"$options $1,$2,$3\""
eval "main_help=\"$main_help \t -$1,--$2\n\""
eval "main_help=\"$main_help \t $4\n\n\""
}
function OptionWithArgument()
{
ARGUMENT=`echo $3 | tr a-z A-Z`
eval "options_warg=\"$options_warg $1,$2,$3\""
eval "main_help=\"$main_help \t -$1 $ARGUMENT, --
g****g
发帖数: 1828
6
i made a simple bash script like this:
#!/bin/bash
# ch.sh
cd ..
when i do ./ch.sh, it still stays in the same directory. only when i do
source ch.sh it works.
anyone knows the reason? how to make it run ./ch.sh?
E*V
发帖数: 17544
7
at your prompt
$euv:~/tmp>
input bash
$euv:~/tmp>bash
then input cd /dev/
$euv:~/tmp>cd /dev
$euv:/dev>
then ctrl+D
$euv:/dev> ctrl+D
then you will find that
$euv:~/tmp>
g****g
发帖数: 1828
8
another way to implement this is:
#!/bin/bash
cd ..
# start another shell and replacing the current
exec /bin/bash
g****g
发帖数: 1828
9

based on this, i made a script that you can go up any number of directories
easily. for example, up 3 will go up three directories from current dir.
#!/bin/bash
# go up any number of directories directly.
if [[ $# -eq 0 ]]
then
echo "going up one directory"
cd ..
elif [[ $# -eq 1 ]]
then
echo "going up $1 directory"
for (( i=1; i<=$1; i++ ))
do
cd ..
done
else
echo "Usage: $0 "
echo "For example: up will go up one directory."
echo " up 2 will go up two... 阅读全帖
c******n
发帖数: 4965
10
来自主题: Linux版 - 奇怪的bash bug!
run.sh:
exec bash -x /tmp/cmd
cmd:
echo hello
java some args
exit 1
按理说如果运行run.sh
应该看到
echo hello
java ........
exit 1
但我看到第二行经常就skipped 了!结果只有两行
实际上第二行确实没有执行
it only appears when the arg list for jaba is really long
and when I run run.sh through ssh
my guess is that bash sees a
w*s
发帖数: 7227
11
if i type "echo $VAR" in the bash shell, it displays abc.
but in my script,
#!/bin/bash
echo $VAR;
echo $PATH;
it outputs this without "abc", why ?
administrator@ubuntu:~/dummy$ ./t0.sh
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
l*********o
发帖数: 3091
12
bash 这种开销太多,动不动fork process. 我是能用python 就不用bash.
o*****l
发帖数: 539
13
来自主题: Linux版 - bash to implement Map>
请教大侠们一个问题, 谢谢!
Is it possible to use bash to implement a data structure like
Map> in Java?
I tried this(test.sh), which fails
$ ./test.sh
d1FileToScriptMap
./test.sh: line 27: ${${myMap}["entities.csv"]}: bad substitution
line 27 is "scriptfile=${${myMap}["entities.csv"]}"
========= test.sh ===============================
#!/bin/bash
dataSources=("d1" "d2")
declare -A dataSrcToScriptAssociateArrayMap
dataSrcToScriptAssociateArrayMap=(
["d1"]=d1FileToScriptMap
... 阅读全帖
n******7
发帖数: 12463
14
来自主题: Linux版 - bash.exe alternative?
win10的linux subsystem太爽了
其实这个subsystem存在很多年了
但是一直都是鸡肋,远不如cygwin流行
我去年听传言说这个要在windows 10里面remove了
还觉得非常遗憾,因为即使鸡肋,也有翻身的可能
要是去掉了,就没戏了
不成想软软雄起了一把,win10内置官方支持的ubuntu bash shell
对我这种喜欢win+lin的人简直太方便了
刚刚装了python numpy一套玩意,跟ubuntu下面一样方便
几乎完美了
现在唯一的问题:bash.exe太简陋了,跟putty差不多,有没有第三方工具,那怕是个
wrapper也好
起码给我一个tab支持吧
n******t
发帖数: 4406
15
来自主题: Linux版 - bash.exe alternative?
沒懂什麼叫做真linux shell,
shell就是一堆編譯出來的代碼,cygwin的bash也是從bash編譯出來的。
w***g
发帖数: 5958
16
来自主题: Programming版 - bash中怎样进行变量名递归替换?
太赞了,解决了我长久以来的问题。
BTW, 你说的bash手册是man bash吗?
s***o
发帖数: 6934
17
google result first one 'bash for loop'...
http://www.cyberciti.biz/faq/bash-for-loop/
o******n
发帖数: 511
18
我还看了这个的,看来没仔细看。
你说的是这个吗:
#!/bin/bash
for file in /etc/*
do
if [ "${file}" == "/etc/resolv.conf" ]
then
countNameservers=$(grep -c nameserver /etc/resolv.conf)
echo "Total ${countNameservers} nameservers defined in ${file}"
break
fi
done
其实我可以跳开前面几万个文件,类似底下这个方法:
#!/bin/bash
FILES="$@"
for f in $FILES
do
# if .bak backup file exists, read next file
if [ -f ${f}.bak ]
then
echo "Skiping $f file..."
continue # read next file and s... 阅读全帖
t***q
发帖数: 418
19
来自主题: Programming版 - 大家会在bash里边写循环吗?
可以的,我以前的工作里,常用bash 写循环。可以。就是可能语法,感觉有点怪,相
比python, perl.

bash
n****t
发帖数: 39
20
来自主题: Unix版 - A qucik Q about bash alias
Hi,
I try set an alias under bash, something like
alias del '/bin/mv \!* /tmp/ '
but under bash, the alias (alias del='/bin/mv $* /tmp/')
always complain that tmp foler cann't be overwritten.
I sewarched nline but in vain. Could anyone give me a pointer?
I would appreciate you may reply to my email account as well.
Thanks!
p**v
发帖数: 853
21
来自主题: Unix版 - how can I change csh to tcsh or bash
if just want to try tcsh or bash, just key in
tcsh or bash(maybe bsh). permanent change, then
use chsh /bin/tcsh depends on the actual path.
j******4
发帖数: 6090
22
来自主题: Statistics版 - 求教linux bash 命令象R那样处理数据
可以的,不过你说的太笼统了,你具体想实现什么?
可以上google上多查查,先确定你用的是bash还是c-shell什么的,不同的shell有不同
的flavor。
% finger user 可以输出你用的是bash还是c-shell
% cat a.txt b.txt 可以把a接到b的后面,类似R里的 c(a,b)
其他的一时还想不出来。
如果有些东西在Unix里不好实现,你可以写个R script,里面你从读文件,
manipulation,然后write.table都写好,存成一个.r的file (e.g. tmp.r,用下面的
命令可以直接在unix里调用R:
% R CMD BATCH tmp.r
就可以得到你在R里自己定义好的输出文件。
刚学unix,抛砖引玉
f********m
发帖数: 8397
23
========================================================
寄信人: nissanxterra (Xterra)
标 题: Re: 新人求推荐跑长途二手车,要耐操,1w-1w4的预算吧
发信站: 未名空间 (Mon Jul 18 20:22:15 2011)
来 源: 129.115.
No offense, simply give my opinion. On the other hand, only car compliment
allowed here?

==================================================
寄信人: nissanxterra (Xterra)
标 题: Re: 新人求推荐跑长途二手车,要耐操,1w-1w4的预算吧
发信站: 未名空间 (Mon Jul 18 20:30:32 2011)
来 源: 129.115.
Got it. Let me see if there is any other "car bashing post". If I find... 阅读全帖
w*******y
发帖数: 60932
24
A bunch of new game deals for Wii popped up on BestBuy's Outlet center. Here
are the ones I thought most noteworthy, and there are more on the Outlet
Center main page:
NHL 2K11 ($8.99) Link:
http://www.bestbuy.com/site/NHL 2K11 - Nintendo Wii/1161907.p?id=1218227993226&skuId=1161907
Wii Mountain Sports ($5.99) Link:
http://www.bestbuy.com/site/Mountain Sports - Nintendo Wii/9629037.p?skuId=9629037&productCategoryId=abcat0706002&id=1218134230009
Boom Blox Bash Party ($7.99) Link:
http://www.bestb... 阅读全帖
D**s
发帖数: 6361
25
【 以下文字转载自 USANews 讨论区 】
发信人: teddypig (减肥了), 信区: USANews
标 题: Ex-CIA chief Brennan bashes Trump over speech during CIA visit
发信站: BBS 未名空间站 (Sat Jan 21 21:08:43 2017, 美东)
这厮昨天刚滚蛋,今天酸劲来了,哈哈哈
http://www.cnn.com/2017/01/21/politics/trump-to-cia-i-am-so-behind-you/
b*******s
发帖数: 3614
26
来自主题: Olympics版 - 怎么开始有人bash博尔特了?
那美国人bash也就行了,这里怎么也有几个上窜下跳?
l****z
发帖数: 29846
27
Poor ‘Senior’ in Dem Ad Bashing George Allen is Actually Democrat Trial
Lawyer
by Jammie
How sloppy. Can’t they just pay someone to read the talking points instead
of one of their own donors?
An elderly man in a widely seen Democratic TV ad who assails Virginia
Senate candidate George Allen for backing partial privatization of Social
Security, possibly threatening his fixed income, is a prominent Democratic
trial lawyer known for defending former Redskins owner Jack Kent Cooke in
his legal t... 阅读全帖
j*********r
发帖数: 24733
p******e
发帖数: 897
29
President Donald Trump has now golfed for three consecutive days, despite
the fact that he vowed to get back to work on the day after Christmas.
While there’s nothing inherently wrong with the president golfing, it does
make things awkward for Trump given his past relentless criticism of former
President Barack Obama’s golfing habits.
Given this, Trump has repeatedly downplayed or tried to conceal his own
golfing exploits, despite the fact that he has hit the links in his first
year more times t... 阅读全帖
h****o
发帖数: 16778
30
来自主题: Automobile版 - why bash 328, promote 335?
LS bash things you don't get
z*****x
发帖数: 192
31
我手里有三张 12月7 号, 晚上7点, 在Allstate Arena, B96 Jingle Bash ft Taylor
Swift演唱会门票, 因为突然有事所以去不了了,所以现在希望可以转卖一下, section
114, Row M.
同样的座位在stubhub 上已经是 $190一张加手续费了.
所以我希望可以 $180 一张, 或者$520 三张一起.
有兴趣的朋友请站内联系, 谢谢
z*****x
发帖数: 192
32
我手里有三张 12月7 号, 晚上7点, 在Allstate Arena, B96 Jingle Bash ft Taylor
Swift演唱会门票, 因为突然有事所以去不了了,所以现在希望可以转卖一下, section
114, Row M.
同样的座位在stubhub 上已经是 $190一张加手续费了.
所以我希望可以 $180 一张, 或者$520 三张一起.
有兴趣的朋友请站内联系, 谢谢
e****e
发帖数: 677
33
白人们bash吗?
d********t
发帖数: 9628
34
你以为bash是中国人发明的?
D***r
发帖数: 7511
35
sort -t"," -k1,1 af.csv > afs.csv
cat bf.csv | sort -t"," -k1,1 | join -t"," -1 1 -2 1 -a 1 -o '0,1.1,1.2,2.1,
2.2' -e "" - afs.csv | grep -v "^87" > outf.csv
I'm not familiar with bash script. Thanks.
b**t
发帖数: 102
36
来自主题: Stock版 - 不就是比谁能bash嘛
股市里找男人,就是和尚庙里找篦梳
bobobobo算男人么?7/14喊大底,第二天就被扇了个巴掌,因为俺的系统不agree
psp算男人么?上上个星期喊大干快上的时候玩了,忽悠大家卖call/put赚点premium,
还是俺跳出来喊大家别这么整,结果大家也看到了吧
俺是男人么?帐号连他们两个的1/N都不到
股市里只有纪律和墙头草,要一根筋做男人,还是准备见外婆吧
赚你的钱,让别人bash去吧,因为我们都不是男人
kaka
k********n
发帖数: 18523
37
我没法讲啊,事实才能说明一切!大家耐心等等吧,拿出去年夏天的劲头,那时候本版
BASH的人可是不少的。
T*********s
发帖数: 17839
38
来自主题: Stock版 - AIG holder should thank CTC's bash
CTC, please bash it harder
b*******e
发帖数: 6389
39
来自主题: Stock版 - 昨天梦里被人在股版bash
俺不是牛,也不怕bash。
俺还梦见上了时间列车,这个从来没想过啊。
f******e
发帖数: 6488
40
such kind of bash is forbidden in stockcafeteria club
all club member need remember this in heart
p********9
发帖数: 3732
41
来自主题: Stock版 - 投诉llcutie今天多次bashing
请斑竹公正处置此人多次bash的行径。
谢谢。
首页 1 2 3 4 5 末页 (共10页)