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 02-03-2005, 10:29 PM   #1
JoannesX
Member
 
Registered: Dec 2004
Location: Brazil
Distribution: Slackware
Posts: 99

Rep: Reputation: 15
problem transfering result of search to a dialog box


OK, the thing is:

I'm not able to figure out a way to put the results of my searchs in a "grafic" dialog.
My shell script contains the lines:
========================================================
#for the search I use the "find" command:

echo "Type the key word"
read variable
find / -name $variable

#and I wanted the result of this search to be transferred to some dialog box
#such as:

dialog --title "xxxx" --backtitle "xxxx" \
--msgbox "the result of the search" 12 12

#I have already tried to send the result to some .tmp file adding this to the
#"find" command:

find / -name $variable 2>/tmp/result.tmp

#but the result is not sent to this file (is the "2>" only used for transferring
#errors (for example) to the especified path?
#Sure that after that I have transformed the content of that file in a variable
#for it to be "echoed" in the dialog box.
#Am I using the wrong type of dialog box?
#If one of you more experienced with this knows how to do it, I'd be grateful!
 
Old 02-05-2005, 04:14 PM   #2
Brain Drop
Member
 
Registered: Feb 2003
Location: just outside reality
Distribution: balanced
Posts: 752

Rep: Reputation: 35
This is what I came up with:

Code:
echo "Type the key word"
read variable
RSLT=`find . -name "$variable"`
dialog --title "xxxx" --backtitle "xxxx" \
 --msgbox "$RSLT"  40 40
Works for me, edit the 40 40 to whatever size you want, and perhaps look into runing RSLT through some filters to clean up the output.
 
Old 02-06-2005, 10:46 AM   #3
JoannesX
Member
 
Registered: Dec 2004
Location: Brazil
Distribution: Slackware
Posts: 99

Original Poster
Rep: Reputation: 15
aaaaahhhh thank god or whoever sent you!!!
I was getting crazy with all the delay for someone to post a so suitable answer...

thank u man! It sounds like I've made a confusion with the variables!
that got going pretty well!!
 
Old 02-07-2005, 06:59 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,433

Rep: Reputation: 203Reputation: 203Reputation: 203
yes

2>
is only stderr
1> or normally simply >
is stdout
both would be:
2>&1>

>> file means append to file
 
  


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
Dialog box help!!!!!!!! HopelessLinuxNewbie Fedora 1 08-24-2005 12:48 PM
Java: Getting the contents of a search dialog box in text editor i am making ludeKing Programming 4 04-23-2004 09:46 PM
mozilla session problem (did search could not find result) exodist Linux - Software 2 02-29-2004 05:10 PM
Dialog box scripting.... r_jensen11 Programming 2 01-25-2004 07:40 PM
Transfering many users accounts from a FreeBSD 4.4 box to another one stepbysteph *BSD 1 11-09-2003 01:26 PM

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

All times are GMT -5. The time now is 09:52 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration