Hi All,
I have a file with the contents as below.
Current_path/file1
Current_path/file2
Current_path/file3
Now i want a regular expression to copy this files to
cp Current_path/file1 HOME_DIR/Current_path/file1
cp Current_path/file2 HOME_DIR/Current_path/file2
cp Current_path/file3 HOME_DIR/Current_path/file3
Could you guys please help me to do this.
Thanks in advance,
Girish.
Try it first without the colored part:
sed 's#\(.*\)#cp & HOME/DIR/&#' file | sh
I thinks you don't need regexes for this:
cat file | cpio -pumd $HOME