Difference between revisions of "Object3D"
From CSWiki
(→linux tips) |
(→linux tips) |
||
Line 4: | Line 4: | ||
* Set default group | * Set default group | ||
newgrp groupname | newgrp groupname | ||
− | Remark: this command will start a nested shell. If you want to use the command in a startup script like in .bashrc, to avoid infinite loop, you should put it in an "if" expression like this: | + | Remark: this command will start a nested shell. If you want to use the command in a startup script like in .bashrc, to avoid |
+ | infinite loop, you should put it in an "if" expression like this: | ||
if [ `id -gn` != "object3d" ] | if [ `id -gn` != "object3d" ] | ||
then | then | ||
Line 13: | Line 14: | ||
chsh -s /bin/bash haosu | chsh -s /bin/bash haosu | ||
* I/O Redirection | * I/O Redirection | ||
− | if you want to redirect both standard out and standard error, you can use: 1>out 2>&1, where out is a filename, 1 stands for STDOUT, and 2 for STDERR | + | if you want to redirect both standard out and standard error, you can use: 1>out 2>&1, where out is a filename, 1 stands for |
+ | STDOUT, and 2 for STDERR | ||
=== python tips === | === python tips === |
Revision as of 21:35, 31 December 2008
linux tips
- Changing Default permissions when creating a new directory
umask u=rwx,g=rwx,o=
- Set default group
newgrp groupname
Remark: this command will start a nested shell. If you want to use the command in a startup script like in .bashrc, to avoid infinite loop, you should put it in an "if" expression like this: if [ `id -gn` != "object3d" ] then newgrp object3d exit fi
- Change default shell
chsh -s /bin/bash haosu
- I/O Redirection
if you want to redirect both standard out and standard error, you can use: 1>out 2>&1, where out is a filename, 1 stands for STDOUT, and 2 for STDERR