[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: HELP: Why bash fails to assign a variable when /tmp is full?
From: |
Zhao, Landy (NSB - CN/Qingdao) |
Subject: |
RE: HELP: Why bash fails to assign a variable when /tmp is full? |
Date: |
Tue, 17 Mar 2020 07:42:48 +0000 |
Ohhhhhhh, I forget it!
Thank you, Andreas,
You are so sharp.
Yes, I'm using ksh.
I made a try, seems bash doesn't have this issue.
For ksh, it seems an output stream exception issue.
https://github.com/att/ast/blob/683bccf3bab8545b6334ab7b7c179e08f5eb89fa/src/cmd/ksh93/sh/io.c:500
Anyway, I will switch to bash.
Thank you.
Thanks,
Landy Zhao
-----Original Message-----
From: Andreas Kusalananda Kähäri <address@hidden>
Sent: 2020年3月17日 15:06
To: Zhao, Landy (NSB - CN/Qingdao) <address@hidden>
Cc: address@hidden
Subject: Re: HELP: Why bash fails to assign a variable when /tmp is full?
On Tue, Mar 17, 2020 at 03:06:38AM +0000, Zhao, Landy (NSB - CN/Qingdao) wrote:
> Hello,
> I find that when /tmp is full, bash can't assign a value to a variable. Wile
> it still can execute command.
> It occurs every time.
>
> Does anyone know the reason?
> Can this behavior be changed? (seems no relationship with TMPDIR)
>
> <centos-b:root>/root:
> # dd if=/dev/zero of=/tmp/ldt
> dd: writing to '/tmp/ldt': No space left on device
> 1023777+0 records in
> 1023776+0 records out
> 524173312 bytes (524 MB) copied, 1.66945 s, 314 MB/s
> <centos-b:root>/root:
> # df -h /tmp
> Filesystem Size Used Avail Use% Mounted on
> tmpfs 500M 500M 0 100% /tmp
> <centos-b:root>/root:
> # a=`ls`
> -ksh: write to 4 failed [No space left on device]
You're not running bash, you're running ksh.
The issue is either in storing some temporary output of the command
substitution before assigning it to your variable, or (and) it could have
something to do with ksh's history file management (if it uses /tmp or not, I
don't know), or something else the shell is using /tmp for. In any case,
filling up /tmp will have all sort of negative consequences.
--
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden
.