2

So I made a mistake working on a school assignment and I'm curious what exactly it is that I did.

I used ssh to log in to a supercomputer provided for the class and used scp to copy a file to my $HOME directory.

I tried to copy the file from my $HOME directory to my $WORK directory using cp file $WORK. This resulted in a new file called $WORK.

I then tried to rm $WORK, froze, and logged back in to a banner informing me that:

The following filesystem(s) are currently unavailable:  /work
You will NOT be able to submit jobs while these are being worked on.
You will receive email when they/it are available again

The newly-created file $WORK is still present. So my guess is that rm $WORK attempted to/succeeded in removing whatever was referred to by the environmental variable $WORK? Or was that command evaluated to rm -rf /*, as mentioned in this Stack Overflow post?

edit: I just realized that this isn't a Ubuntu-specific issue, as I believe the server is running RHEL. I assume whatever I did would be applicable to both distributions, though.

1

You made a tipical mistake using shell variables.

See explicit information about your mistake at http://mywiki.wooledge.org/BashPitfalls

Additionally your should clear out what was the contents of your $WORK variable.

It seems that you copied the contents of the file "file" to a file named "$WORK" instead of copying to the file that is named in the $WORK variable. If you want to delete the new file please use quotes like:

rm  "$WORK"
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.