Re: how to view environment variables
Oliver Fromme wrote: Chris Whitehouse wrote: > sysutils/fusefs-ntfs/files/README.FreeBSD refers to various environment > variables, eg UBLIO_BLOCKSIZE and others. How do I find out what they > are set to? set and printenv don't find them. I'm using standard csh and > FreeBSD 7.0-STABLE, fuse.ko is loaded and ntfs-3g works except it > seems very slow. The "env" command prints the environment variables of your current shell (should work with any shell). To view the environment variables of another process, use something like "ps -ewwp 1234" (1234 being the PID number). This requires PROCFS to be mounted on /proc. Best regards Oliver This is the last bit of the puzzle. It does indeed print environment variables set with 'env VAR=foo prog' but as I've now understood from previous replies the program doesn't set variables, it uses them if they are already set, otherwise uses defaults. Thanks Chris ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: how to view environment variables
Chris Whitehouse wrote: > sysutils/fusefs-ntfs/files/README.FreeBSD refers to various environment > variables, eg UBLIO_BLOCKSIZE and others. How do I find out what they > are set to? set and printenv don't find them. I'm using standard csh and > FreeBSD 7.0-STABLE, fuse.ko is loaded and ntfs-3g works except it > seems very slow. The "env" command prints the environment variables of your current shell (should work with any shell). To view the environment variables of another process, use something like "ps -ewwp 1234" (1234 being the PID number). This requires PROCFS to be mounted on /proc. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "The scanf() function is a large and complex beast that often does something almost but not quite entirely unlike what you desired." -- Chris Torek ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: how to view environment variables
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Whitehouse wrote: > RW wrote: >> On Sun, 15 Jun 2008 00:27:10 +0100 >> Chris Whitehouse <[EMAIL PROTECTED]> wrote: >> >>> Hello, >>> >>> sysutils/fusefs-ntfs/files/README.FreeBSD refers to various >>> environment variables, eg UBLIO_BLOCKSIZE and others. How do I find >>> out what they are set to? set and printenv don't find them. I'm using >>> standard csh and FreeBSD 7.0-STABLE, fuse.ko is loaded and ntfs-3g >>> works except it seems very slow. >> >> If you didn't set them, they probably aren't set. You'll need to >> consult the fusefs-ntfs documentation (or source) to find the default >> value. > > I think this explains part of my confusion. If the variables are not set > ntfs-3g assumes some defaults (in README.FreeBSD) but doesn't set them > as environment variables. I thought ntfs-3g would actually set them. I > still don't know how to view them when I have explicitly set them, as > per previous reply to Robert Huff. > > eco# env UBLIO_BLOCKSIZE=65536 ntfs-3g /dev/ad0s1 /ad0s1 > eco# setenv |grep UBLIO > eco# I just picked up on this ... environmental variables are part of the private environment of programs. Those variables are given to any child programs. If the programs are shells, shells specialize in creating child programs, so all those environmental variables get given to the children. A filesystem doesn't create children, it just organizes the storage and presentation of disk data, so when you set a environmental variable to a filesystem, it may react to that variable if it is programmed that way, but it doesn't send it anywhere. If you want to see the variable in your shell, then you must tell the shell to set it in it's environment. For a sh-like shell, you would do something like: export UBLIO_BLOCKSIZE=65536 For a csh-like shell, use: setenv UBLIO_BLOCKSIZE 65536 (Notice that a csh-like shell DOESN'T use the "="). Your filesystem prog is being told of your variable above, but your attempt to see it is misguided. There was a way to see the information, using the e option to ps, but it was always a security problem, so it seems like that was removed from FreeBSD (it's probably controlled by a sysctl). I think it still works in most linuxes. Reading the variables is very easy to do with the "env" program, where if you give it no args, it repeats all the variables. Try it. It works for all shells, unlike your "setenv", because it's an actual program (/usr/bin/env). setenv is, for a csh-like shell, a shell built-in, not a real program. The way it goes to programs is via 3 variables given to every program. They are, in the order they're presented: 1- argc, which means the number of parameters given to the program by the shell 2- argv, a list of string pointers, to program parameters 3- envp, a list of string pointers, to name=value pairs, for all environmental variables given to each program. Those names are only the commonly used names, they may be changed completely at will, because the system only gives the info in the order I gave, and doesn't associate the info with any names. Your program needs to associate some names to the parameters so that you can manipulate them, and using these names is a good idea so as not to confuse other programmers, just don't get the idea that those names have any real magic meaning on their own. I could write a program using manny, moe, and jack as the names of the 3 items given to a program, and (beyond making things confusing) that program would work just fine. Writing a small program that annouces the arguments count, and prints all of the parameters, and all of the env. variables, makes a fine beginners first program. > > Chris > >> ___ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to >> "[EMAIL PROTECTED]" >> > > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "[EMAIL PROTECTED]" -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIVUh7z62J6PPcoOkRAp5+AKCAuGFkXoiWMzthzPqpQfR3lGPamQCdH9KI UJwnNE1c7ox5JrSwHoEzJWo= =4Oue -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: how to view environment variables
On Sun, 15 Jun 2008 02:05:07 +0100 Chris Whitehouse <[EMAIL PROTECTED]> wrote: > RW wrote: > > On Sun, 15 Jun 2008 00:27:10 +0100 > > Chris Whitehouse <[EMAIL PROTECTED]> wrote: > > > >> Hello, > >> > >> sysutils/fusefs-ntfs/files/README.FreeBSD refers to various > >> environment variables, eg UBLIO_BLOCKSIZE and others. How do I find > >> out what they are set to? set and printenv don't find them. I'm > >> using standard csh and FreeBSD 7.0-STABLE, fuse.ko is loaded and > >> ntfs-3g works except it seems very slow. > > > > If you didn't set them, they probably aren't set. You'll need to > > consult the fusefs-ntfs documentation (or source) to find the > > default value. > > I think this explains part of my confusion. If the variables are not > set ntfs-3g assumes some defaults (in README.FreeBSD) but doesn't set > them as environment variables. I thought ntfs-3g would actually set > them. I still don't know how to view them when I have explicitly set > them, as per previous reply to Robert Huff. > > eco# env UBLIO_BLOCKSIZE=65536 ntfs-3g /dev/ad0s1 /ad0s1 > eco# setenv |grep UBLIO > eco# If you set them separately in the shell the new process will inherit them - env only sets the environment in the new process. This wont buy you anything though for the reason you mention, and because parent processes don't pick-up changes to the environment made by child-processes anyway. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: how to view environment variables
RW wrote: On Sun, 15 Jun 2008 00:27:10 +0100 Chris Whitehouse <[EMAIL PROTECTED]> wrote: Hello, sysutils/fusefs-ntfs/files/README.FreeBSD refers to various environment variables, eg UBLIO_BLOCKSIZE and others. How do I find out what they are set to? set and printenv don't find them. I'm using standard csh and FreeBSD 7.0-STABLE, fuse.ko is loaded and ntfs-3g works except it seems very slow. If you didn't set them, they probably aren't set. You'll need to consult the fusefs-ntfs documentation (or source) to find the default value. I think this explains part of my confusion. If the variables are not set ntfs-3g assumes some defaults (in README.FreeBSD) but doesn't set them as environment variables. I thought ntfs-3g would actually set them. I still don't know how to view them when I have explicitly set them, as per previous reply to Robert Huff. eco# env UBLIO_BLOCKSIZE=65536 ntfs-3g /dev/ad0s1 /ad0s1 eco# setenv |grep UBLIO eco# Chris ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: how to view environment variables
Robert Huff wrote: Chris Whitehouse writes: sysutils/fusefs-ntfs/files/README.FreeBSD refers to various environment variables, eg UBLIO_BLOCKSIZE and others. How do I find out what they are set to? set and printenv don't find them. I'm using standard csh In that case, try "setenv" with no arguements. Robert Huff No not that either. Shouldn't I somehow be able to get into ntfs-3g's environment? From README.FreeBSD eco# env UBLIO_BLOCKSIZE=2097152 ntfs-3g /dev/ad0s1 /ad0s1 eco# echo $UBLIO_BLOCKSIZE UBLIO_BLOCKSIZE: Undefined variable. But it must be getting set because write speed changes when the block size is changed. Chris ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: how to view environment variables
On Sun, 15 Jun 2008 00:27:10 +0100 Chris Whitehouse <[EMAIL PROTECTED]> wrote: > Hello, > > sysutils/fusefs-ntfs/files/README.FreeBSD refers to various > environment variables, eg UBLIO_BLOCKSIZE and others. How do I find > out what they are set to? set and printenv don't find them. I'm using > standard csh and FreeBSD 7.0-STABLE, fuse.ko is loaded and ntfs-3g > works except it seems very slow. If you didn't set them, they probably aren't set. You'll need to consult the fusefs-ntfs documentation (or source) to find the default value. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: how to view environment variables
Chris Whitehouse <[EMAIL PROTECTED]> wrote: > sysutils/fusefs-ntfs/files/README.FreeBSD refers to various environment > variables, eg UBLIO_BLOCKSIZE and others. How do I find out what they are > set to? set and printenv don't find them. I'm using standard csh and > FreeBSD 7.0-STABLE, fuse.ko is loaded and ntfs-3g works except it seems > very slow. Did you read the csh(1) man page? setenv [name [value]] Without arguments, prints the names and values of all environment variables. Given name, sets the environment variable name to value or, without value, to the null string. -- Sahil Tandon <[EMAIL PROTECTED]> ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"