I am trying to use a service menu that calsl a bash script and logs in to a remote server and executes a command on the file or folder. It should work but sed is not stripping sftp from the url path.
Code:
url=${1} echo "url: $url" # debug line if echo "$url" | grep -Ev "s+sftp://\w*@\w*/+/+"; then echo "Not a valid remote path: $url" return 1 fi # This part checks for the sftp://user@host and returns if it is not found, this should stop it from running on files not accessed via sftp stripedurl=`echo "${url}" | sed 's+sftp://\w*@\w*(.\w*)?++'`
Comment