I have below script to extract the current open file path in Gedit.
#!/bin/bash
origPath=$GEDIT_CURRENT_DOCUMENT_URI
if [[ $origPath == *"smb"* ]]
then
finalPath=`php -f /var/www/html/pathswapcmd.php smb_path=$origPath`;
else
finalPath=$origPath;
fi
## echo -n $finalPath;
echo -n $finalPath | sed 's/^.*app/app/p' | xclip -sel clip;
exit;
Generally I have Magento files in my system so my path needs to start from app, skin folders etc. only.
Now when I try to remove everything before app with sed it removes but it gives the path three times separated with a junk character which is not identifiable(ofcourse) in the address bar of Ubuntu folder manager.
I want simple and clear solution of removing duplicate lines from sed command.
