samwise wrote:
with the contents performing the action I required, so something like:
#!/bin/bash # Convert XLS files to CSV... notrailspace=$(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sed -e 's/^ *//' -e 's/ *$//') sh /usr/bin/xls2csv "$notrailspace"
Thanks for the help so far, this looks like a good opportunity to learn something new. I was determined to make 2008 the year of learning new stuff and I'm leaving it a bit late to get started!
Based on the above (and very little bash script skills!) I tried: #!/bin/bash # Convert XLS files to CSV... files=$(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sed -e 's/^ ?(.*)(.xls) ?/"\1\2" > "\1.csv"/i') xls2csv $files
.. which I wanted to take /path/to/foo.xls and run xls2csv /path/to/foo.xls > /path/to/bar.csv
It doesn't work (no surprised on a first test like this) but I have absolutely no idea how to debug it? Where would errors go?