Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Where am I?

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 02-09-2009
ruben.rodrigues ruben.rodrigues is offline
Registered User
 
Join Date: Jan 2009
Last Activity: 5 July 2010, 3:43 AM EDT
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Where am I?

Hi!

Is there any command to tell me where did I click? I know it's a litle confuse but it's like this.
if I execute this script by clicking with the right button of my mouse, it gaves me the dir or file where I clicked


#!/bin/sh
zenity --info --title="Echo:" --text "`echo "?????"`"

this would be useful to use in a program that I've in mind

thanks
Sponsored Links
    #2  
Old Unix and Linux 02-09-2009
quirkasaurus's Unix or Linux Image
quirkasaurus quirkasaurus is offline Forum Advisor  
Registered User
 
Join Date: Jan 2009
Last Activity: 7 July 2012, 10:53 AM EDT
Location: canton, michigan
Posts: 483
Thanks: 0
Thanked 8 Times in 8 Posts
this zenity script is just a "do-nothing" little script...

--info gives the little lightbulb....
--title sets the window title
--text gives you a text label....

You mean, you want it to give you the directory that you click?

Sure, try something like this:


Code:

dir=$(

  zenity --list --title="Choose the directory you wish to view" \
       --column="Directory" \
admin \
bin \
data \
deploy \
lost+found \
pdc \
scratch \
web \
webnet \
  )



print dir=$dir

Sponsored Links
    #3  
Old Unix and Linux 02-09-2009
ruben.rodrigues ruben.rodrigues is offline
Registered User
 
Join Date: Jan 2009
Last Activity: 5 July 2010, 3:43 AM EDT
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by quirkasaurus View Post
this zenity script is just a "do-nothing" little script...

--info gives the little lightbulb....
--title sets the window title
--text gives you a text label....

You mean, you want it to give you the directory that you click?

Sure, try something like this:


Code:

dir=$(

  zenity --list --title="Choose the directory you wish to view" \
       --column="Directory" \
admin \
bin \
data \
deploy \
lost+found \
pdc \
scratch \
web \
webnet \
  )



print dir=$dir

Man, the idea is to not need to enter the directory. Is to write a script that tells me in which directory I am or in which file did I click
    #4  
Old Unix and Linux 02-09-2009
quirkasaurus's Unix or Linux Image
quirkasaurus quirkasaurus is offline Forum Advisor  
Registered User
 
Join Date: Jan 2009
Last Activity: 7 July 2012, 10:53 AM EDT
Location: canton, michigan
Posts: 483
Thanks: 0
Thanked 8 Times in 8 Posts
Quote:
Originally Posted by ruben.rodrigues View Post
Man, the idea is to not need to enter the directory. Is to write a script that tells me in which directory I am or in which file did I click

Oh. Try this, man.



Code:
#!/bin/sh
 
file=`zenity --list --title="Choose the FILE you wish to view" --column="File" *`
 
zenity --info --title="file, directory..." --text "directory: $PWD\nfile: $file"

Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -4. The time now is 05:29 AM.