On Sat, 13 Aug 2005, Giorgos Keramidas wrote:
On 2005-08-12 13:38, Benson Wong [EMAIL PROTECTED] wrote:
I prefer:
for COREFILE in `find / -type f -name core -print`
do
...
done
Wouldn't that accomplish the same thing?
More or less. Less, when the filenames are
I prefer:
for COREFILE in `find / -type f -name core -print`
do
...
done
Wouldn't that accomplish the same thing?
On 8/12/05, Ian Smith [EMAIL PROTECTED] wrote:
On Fri 12 Aug 2005 09:33:54 +0800 Xu Qiang [EMAIL PROTECTED] wrote:
find / -type f -name core -print | while
On 2005-08-12 13:38, Benson Wong [EMAIL PROTECTED] wrote:
I prefer:
for COREFILE in `find / -type f -name core -print`
do
...
done
Wouldn't that accomplish the same thing?
More or less. Less, when the filenames are too many. See questions
posted on this very same list about ``too many
On Fri, 12 Aug 2005, Xu Qiang wrote:
Hi, all:
I don't know if this is the right list to ask this question. But since I
didn't find a bash script mail list and you guys are always so helpful,
then...
Here are an excerpt of a bash script:
dpk wrote:
On Fri, 12 Aug 2005, Xu Qiang wrote:
As soon as you used the pipe, to the while, you entered a sub-shell.
There's no way (that I'm aware of anyways) to get the sub-shell's
variables sent back up to the parent.
Thanks for your detailed analysis and a solution. Yes, I didn't notice
On 2005-08-12 10:16, Xu Qiang [EMAIL PROTECTED] wrote:
Btw, can we export a value in the sub-shell back to the parent?
Only through `backquote subtitution', as the child process cannot affect
the environment of the parent process.
value=`shell command`
value=$(shell command)
Giorgos Keramidas wrote:
On 2005-08-12 10:16, Xu Qiang [EMAIL PROTECTED] wrote:
Btw, can we export a value in the sub-shell back to the parent?
Only through `backquote subtitution', as the child process cannot
affect the environment of the parent process.
value=`shell command`
dpk wrote:
On Fri, 12 Aug 2005, Xu Qiang wrote:
1. The way of incrementing the variable NCOREFILES. Why does it use
the formula of NCOREFILES=$[ $NCOREFILES + 1 ], and not the direct
way of NCOREFILES=$NCOREFILES+1?
If that was done, NCOREFILES would end up looking like:
+1+1+1+1+1+1+1
This is my test script:
-
#!/bin/bash
var=0
var=$[3]
vari=0
++vari
echo $var
echo $vari
-
The result is:
./test.sh: ++vari: command not found
3
0
So the manual of bash is incorrect?
Regards,
Xu Qiang
On Fri, 12 Aug 2005, Xu Qiang wrote:
This is my test script:
-
#!/bin/bash
var=0
var=$[3]
vari=0
++vari
echo $var
echo $vari
-
The result is:
./test.sh: ++vari: command not found
3
0
So the manual of bash is incorrect?
Regards,
Xu
dpk wrote:
It will work with either 'let' or within an 'arithmetic expansion':
$[++var]
let ++var
By the way, there is another syntax, from the man page, that seems to
operate identically:
$((++var)) and $((var+1))
With let ++var, the result is still 0, it isn't incremented. With
11 matches
Mail list logo