Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
To get it to work, I had to change the script to look like the following:
# Uncomment the following for debugging
# echo "File $filetype"
zenity --info --title="File-Type Determinator" --text="File $filetype" --width=200 --height=200
At one point, I got a message saying gdialog was just a wrapper around zenity, and that I should execute zenity directly.
Why don't you use PeaZip instead of 7z? It has command line options like "-ext2here" that should give you the GUI. 7z is probably a command-line-only application that outputs text to stdout, which would only show up in a terminal.
I have put some questions inline with the code below.
### Why not use /bin/bash?
pathName=`echo $NAUTILUS_SCRIPT_CURRENT_URI | sed -e 's|file:///|/|' -e 's|//|/|' -e 's|%20| |'`
### With bash, the following can be fileNoExt=$(basename $fileName)
### Why not use the following instead
zenity --info --title="DONE Executing" --text="/usr/local/share/PeaZip/bin/PeaZip -ext2folder" --width=200 --height=200
So how comes i've seen plenty of shell script examples, where they use the "echo something"?
Many times I write scripts that use "echo" and a log file. That way, even if the script runs without a TTY, I can see the output of the "echo". For example
# Notice that the first time I write to the log file
# I use the create file redirect ">". Also, I combine
# stderr with stdout using "2>&1", so that I log any
echo "Starting the script..." > $LOGFILE 2>&1
# Notice that from this point on, I use the append file redirect ">>".
/usr/bin/something >> $LOGFILE 2>&1
echo "Done." >> $LOGFILE 2>&1
Originally Posted by kwanbis
Also, fileNoExt=$(basename $fileName) gives nothing, i have tried it before.
Make sure your "bash" is really "bash". Run "ls -al $(which bash)". It may be a link to dash or something in "/etc/alternatives". In either case, it may not be the real full-featured "bash". Accept no substitutes...