Re: 7z command works fine on command line but not in script
On 19/02/14 23:32, berenger.morel@neutralite.org wrote:
>
>
> Le 19.02.2014 10:53, Scott Ferguson a écrit :
>> Just read your last post before sending this, so this may no longer be
>> relevant... I don't know that you need to quote the variables. I use
>> coloured bash
coloured *editor* i.e. nano, vi/emac, dex[*1] or Kwrite is what I meant
to write. If anyone knows of a way to colourise the syntax in xterm
(especially 'fc' temp) I'd be *very* interested.
[*1.] https://github.com/tihirvon/dex
>> so it is usually obvious if I need to. P.S. without the
>> quotes you won't need the escapes - just quote the whole filename (which
>> may be what you are lacking).
>
> I use colors too ( and I have no idea about the reason to disable colors
> by default in Debian... ), but I really do not like interpreted
> languages. My opinion is that stuff written with them are messy, but at
> least, shell is handier than C++ to manage files and shell commands...
> so sometimes I try to automate small tasks with it. Maybe someday I will
> become efficient with it.
I keep telling myself the same thing - in the meantime I debug (with a
hammer).
>
> The error was that I had too many quotes, so some of them were included
> in the name,
I noted Andre's response (and keener eye)
The #!/bin/(bash or sh) -x is useful, after parsing the script you'll
see the outcomes on screen
You may find these useful:-
set -x # same as the minus x in the shell invocation line
trap "echo hit return;read x" DEBUG # step through one line at a time
set -o nounset # display unset variables
function pause(){ # wot it says
read -p "$*"
}
#pause 'Press [Enter] key to continue...'
> but for a reason I can not understand, echo did not
> displayed them.
Colourised nano/vim etc might make it easier to spot.
I've linked my (dodgy) ~/.bashrc in case it proves useful (you should
avoid the lines followed by "hack" comments.)
If you wish:-
$ mv ~/.bashrc{,.bak}
replace with my version
http://paste.debian.net/82999
$ . .~/bashrc
I use the nano syntax rules from:-
https://github.com/nanorc/nanorc
<snipped>
Kind regards
Reply to: