PDA

View Full Version : [ubuntu] Zenity script



Dark006
March 8th, 2009, 10:18 PM
I've got a slight problem with a small script I wrote. What I'm trying to do is have a nautilus script that will save any video saved into memory and using zenity to change the name to what I want. Here is the script thus far


#!/bin/bash
name=$(zenity --entry --title="Rename your Video" --text="Please change to desired name ")
cp /tmp/Fla* ~/Desktop/Flash
mv ~/Desktop/Flash ~/Desktop/$name


It seems to work fine for one word names of the video(like "dog", "cat", etc..). But if I try to name it anything more than one word it just defaults to name it "Flash".

Does anyone have any ideas on what I could do to fix this?

Jose Catre-Vandis
March 8th, 2009, 10:27 PM
Try using inverted commas for the multiple words? e.g.:


mv ~/Desktop/Flash ~/Desktop/"$name"

I tested your zenity code line and it does return multiple words, but the mv command probably won't like it

or

Don't type names with spaces, use _ or - between words, might help you later on when you want to do something else.
Takes a while to get into the habit :)

Dark006
March 8th, 2009, 11:28 PM
Thank you so much Jose Catre-Vandis! The quotes work fine! I don't know why I didn't think of that haha.

Jose Catre-Vandis
March 9th, 2009, 01:26 AM
Thank you so much Jose Catre-Vandis! The quotes work fine! I don't know why I didn't think of that haha.

:)