[SATLUG] BASH script not writing to file

Bruce Dubbs bruce.dubbs at gmail.com
Wed Mar 28 11:53:43 CDT 2012


John Champion wrote:
> Hi,
> 
> I've tried several things with a very basic BASH script to try to figure
> out what is going on and I cannot make heads or tails out of it.
> 
> Here's the script:
> 
> #!/bin/bash
> read -p "What's your name" fname
> echo -e "You typed in $fname" > ./Documents/test.txt
> 
> This works fine in a pure Linux install. This does not work in the VM. It
> is simply not writing to the file. I cannot get stderr to write to a file
> either.
> 
> It's as if the VM is locked even though I'm running this as root (did this
> to see if that made a difference and it didn't).

What is the output of `mount`?  `ls -ld .`?  `pwd`?  `whoami`?

   -- Bruce


More information about the SATLUG mailing list