Category: bash
Different ssh port with rsync
If you want to to backup from/to an ssh server and this server does not run on 22 as port, you can use this workaround:
This will sync from the host user@example.org (by using ssh and port 4321) the folder /home/user/test to the folder backup on your local harddisk.
bash tip: for each line in a file
When you want execute an action on a set of files (all, which contain testfile), this technique is pretty straight forward:
2
3
4
do
rm "$line"
done
But this actually does not work, if the file name contains spaces!
In this cases the "while read"-construct is failsafe:
2
3
4
do
rm "$line"
done
Change recursive CVS repository information on commanline
You can easily apply a new "Root"-file for a recursive checked out repository structure with the following line (assuming, that you don't have any files called "CVS/Root" except the CVS/Root).
In this example /home/dracoblue/Root holds the updated Root-File and the command line is executed in the directory which you want to change recursively.


