LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2007, 07:02 PM   #1
adamruss
Member
 
Registered: Jul 2007
Posts: 44

Rep: Reputation: 15
selection search


hi, i've tried to make my mouse search key search the selected mouse text when i press it, anyway i made this script:

#!/bin/bash
firefox -search `xsel -p -o`

which works great.. for one word only:

firefox -search bla (works)
firefox -search 'bla bla' (works)
firefox -search bla bla (DONT work)

all i need is if somebody knows how do i add the ' ' to the script?

thanks
 
Old 08-12-2007, 08:52 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Try putting quotes around the whole phrase:

firefox -search "`xsel -p -o`"

That seems to work for me, at least with a short test.

Be sure to use double quotes though. Single quotes don't allow variables to expand. You end up searching for the exact contents of the quotes.
 
Old 08-12-2007, 10:54 PM   #3
adamruss
Member
 
Registered: Jul 2007
Posts: 44

Original Poster
Rep: Reputation: 15
haha works!! thanks!!

- how did yiu know i tried ' '
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apple Spotlight, MS Desktop Search and Google Desktop Search. What do you think? Mega Man X General 16 07-10-2007 12:50 PM
L.A.M.P and selection binary_dreamer Programming 5 06-21-2006 02:05 AM
search default: search post title only slackie1000 LQ Suggestions & Feedback 4 03-10-2005 07:50 AM
Quick VIM question (unhighlighting search terms after search) lrt2003 Linux - Newbie 5 05-08-2004 05:21 PM
How to 'apt-cache search' & 'apt-file search' by distribution? davidas Debian 3 04-19-2004 01:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration