Linux vs HP-UX cp command

October 14, 2010 at 11:09:29
Specs: Windows 7
in Linux, cp command can be used with '-v' switch to display the output on the screen

$ cp -v abc.txt 123.txt
`abc.txt' -> `123.txt'

is there something similar to this on HP-UX so I can capture the output into a log?

Thanks in advance.

See More: Linux vs HP-UX cp command

Report •

October 14, 2010 at 12:56:48
The non-GNU version of the cp command does not have a verbose option. You can sort of code for it:



cp $xfile $yfile
if [ $? -eq 0 ]
   echo "$xfile -> $yfile" > $(tty)

By default, the standard output is the terminal. The tty command returns the user's terminal name, so the above script writes to the user's screen even if standard output is redirected to a file.

Report •
Related Solutions

Ask Question