help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] /proc/.../cdrom/info not completely read


From: humpty
Subject: [Help-bash] /proc/.../cdrom/info not completely read
Date: Mon, 30 Apr 2012 08:42:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0

hi,

I encounter a problem when I try to read /proc/sys/dev/cdrom/info

whatever method I try, bash doesn't read the whole file

$ file=/proc/sys/dev/cdrom/info
$ while read line...done <"$file"
only outputs the first line

$ exec {foo}<"$file"
$ while read -u line
outputs about six lines, as does
$ mapfile -t myArray <"$file"
and
$ echo "$(<"$file")"

if I copy "$file" anywhere (say /tmp/) there is no problem any more.
This happens with BASH 4.2 on Debian, and openSuse (and BASH 3.3.4 on archlinux (I've been told))

what could be the reason for such a behaviour?
is there a full bash way around?

thank you.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]