| Summary: | Can't run strings(1) on a (disk) device, even if you want to | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Pierre Beyssac <beyssac> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | emaste |
| Priority: | Normal | ||
| Version: | 5.3-BETA5 | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Pierre Beyssac
2004-10-05 16:00:39 UTC
> # strings /dev/da2s1
> strings: Warning: '/dev/da2s1' is not an ordinary file
I can't speak for why strings does this or whether it should be
considered a bug or not, but a way to override it is
'cat /dev/da2s1 | strings'.
On Wed, Oct 06, 2004 at 05:08:12PM -0400, David Schultz wrote: > I can't speak for why strings does this or whether it should be > considered a bug or not, but a way to override it is > 'cat /dev/da2s1 | strings'. Thanks! Since I sent the PR I have also found "strings < /dev/da2s1" which saves a cat; but still... -- Pierre Beyssac pb@enst.fr According to POSIX: "The /strings/ utility shall look for printable strings in regular files and shall write those strings to standard output." From the looks of it strings isn't supposed to work on devices. Depends on how literally you take "regular files" to mean. -- Ryan Sommers ryans@gamersimpact.com On Thu, Oct 07, 2004 at 11:28:56PM -0500, Ryan Sommers wrote: > According to POSIX: "The /strings/ utility shall look for printable > strings in regular files and shall write those strings to standard output." Well, sorry but I don't quite see in what respect this precludes a POSIX-compliant strings from working on devices too (just as FreeBSD 4.10 strings does). -- Pierre Beyssac pb@enst.fr This is fixed with the migration to ELF Tool Chain strings, as of FreeBSD 11.0. Testing with a memory disk: # newfs_msdos /dev/md0 newfs_msdos: cannot get number of sectors per track: Operation not supported newfs_msdos: cannot get number of heads: Operation not supported /dev/md0: 2003 sectors in 2003 FAT12 clusters (512 bytes/cluster) BytesPerSec=512 SecPerClust=1 ResSectors=1 FATs=2 RootDirEnts=512 Sectors=2048 Media=0xf0 FATsecs=6 SecPerTrack=63 Heads=1 HiddenSecs=0 # strings /dev/md0 BSD4.4 NO NAME FAT12 Non-system disk Press any key to reboot # |