Scripting help needed.
Hi all,
I have a question on scripting . I used to list some files in my remote server along with the hostname and it is working fine . Code:
ssh sever2 'echo -ne $HOSTNAME \\t ;ls -lt /home/zamo/testing` Code:
server2 -rw-r--r-- 1 zamo zamo 25 jan 11 19:01 /home/zamo/tesing I want the file name only , not with the absolute path. Normally I do awk -F\/ '{print $NF}' to cut that and it is not working on remote. I need to get the output as follows. Code:
server2 -rw-r--r-- 1 zamo zamo 25 jan 11 19:01 tesing Thanks |
just cd to the directory first, after the echo.
|
Thanks Chris... Short and Smart way...
|
All times are GMT -5. The time now is 05:37 PM. |