alex_o
January 30th, 2010, 05:29 PM
Old version, no multiple links in command line
#!/bin/bash
# script: winlink
# author: Alex Osborn(alex_osborn0@hotmail.com)
# date: 10 Jan 2010
# tested: Ubuntu 9.10 (amd64)
# description: Opens windows .url files in firefox, feel free to edit and use as needed just dont steal the credits!
#
if [ -f "$1" ];then
if grep URL "$1" > /dev/null;then
firefox -new-tab `grep URL "$1"|grep -iv eurl|tail -c +5`
else
echo invalid linkfile
fi
else
echo empty file
fi
exit
new version, multiple links in command line and in browser
#!/bin/bash
# script: winlink
# version: 0.2
# author: Alex Osborn(alex_osborn0@hotmail.com)
# date: 10 Jan 2010
# tested: Ubuntu 9.10 (amd64)
# description: Opens windows .url files in firefox, feel free to edit and use as needed just dont steal the credits!
#
TMP="/tmp/${0##*/}$$"
cat "$@"|grep -s URL|grep -ivs eurl > $TMP
LINE=1
MAX=`cat $TMP|wc -l`
while [ "$LINE" -le "$MAX" ];do
LINK=`head -q "$TMP" -n $LINE|tail -qn 1|tail -qc +5`
if [ -n "$LINK" ];then
firefox -new-tab "$LINK"
echo "$LINK"
fi
LINE=$((LINE+1))
done
rm $TMP
exit
1. Save the newest code to /home/USERNAME/bin/winlink.sh
2.
chmod a+x /home/USERNAME/bin/winlink.sh
3. In the file browser navigate to a .url file or make a blank one
4. Right click, properties -> open with
5. Click Add, and navigate to /home/USERNAME/bin/winlink.sh
6. Press Open
7. Press Add and then make the default application to launch .url files be winlink
8. Close and test!
#!/bin/bash
# script: winlink
# author: Alex Osborn(alex_osborn0@hotmail.com)
# date: 10 Jan 2010
# tested: Ubuntu 9.10 (amd64)
# description: Opens windows .url files in firefox, feel free to edit and use as needed just dont steal the credits!
#
if [ -f "$1" ];then
if grep URL "$1" > /dev/null;then
firefox -new-tab `grep URL "$1"|grep -iv eurl|tail -c +5`
else
echo invalid linkfile
fi
else
echo empty file
fi
exit
new version, multiple links in command line and in browser
#!/bin/bash
# script: winlink
# version: 0.2
# author: Alex Osborn(alex_osborn0@hotmail.com)
# date: 10 Jan 2010
# tested: Ubuntu 9.10 (amd64)
# description: Opens windows .url files in firefox, feel free to edit and use as needed just dont steal the credits!
#
TMP="/tmp/${0##*/}$$"
cat "$@"|grep -s URL|grep -ivs eurl > $TMP
LINE=1
MAX=`cat $TMP|wc -l`
while [ "$LINE" -le "$MAX" ];do
LINK=`head -q "$TMP" -n $LINE|tail -qn 1|tail -qc +5`
if [ -n "$LINK" ];then
firefox -new-tab "$LINK"
echo "$LINK"
fi
LINE=$((LINE+1))
done
rm $TMP
exit
1. Save the newest code to /home/USERNAME/bin/winlink.sh
2.
chmod a+x /home/USERNAME/bin/winlink.sh
3. In the file browser navigate to a .url file or make a blank one
4. Right click, properties -> open with
5. Click Add, and navigate to /home/USERNAME/bin/winlink.sh
6. Press Open
7. Press Add and then make the default application to launch .url files be winlink
8. Close and test!