Grep Download Found files only

Advertisement

Advertisement

wasimxe
Joined:
Posts:
5
Location:
pakistan

a little progress :)

ok, I modified powershell extension to download files from clipboard

ForEach ($line in $($remotePaths -split "`r`n")){
    Write-Host "Downloading $line..."
    $session.GetFiles("$line", (Join-Path $localPath "*")).Check()
}

Problem: It required absolute path, I guess powershell doesn't support getting current working directory from GUI. So I modified grep command to print full path.

grep "astra_blog_layout_class" -rlHm1  * ${PWD}

Problem Again: This grep command returns one file two times, one with relative path and other with absolute path. When this clipboard run with extension, code stop at first error of file not found from server (because first file path was relative)

Screenshot: https://prnt.sc/lvbt51
Expected Solution: How can make this grep command only return files with absolute paths?

Reply with quote

Advertisement

You can post new topics in this forum