[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [linux_var] bash capitolo 2
- To: linux_var - LUG di Varese e Provincia Mailing List <talking@ml.linuxvar.it>
- Subject: Re: [linux_var] bash capitolo 2
- From: Gianluca Zoni <zoninoz@inventati.org>
- Date: Tue, 16 Jul 2013 00:38:07 +0200
- Authentication-results: linuxvar.it; dkim=pass (1024-bit key; insecure key) header.i=@inventati.org; dkim-adsp=pass
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ml.linuxvar.it; s=mail; t=1373927673; bh=grLiTTYokMV1kfrBM5jB7urv+EozRP1Dd61abO4YHnA=; h=Date:From:To:References:MIME-Version:In-Reply-To:Subject:Reply-To: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Content-Type:Content-Transfer-Encoding:Sender; z=Received:=20from=20latitanza.investici.org=20(latitanza.investici .org=0D=0A=09[82.94.249.234])=20by=20linuxvar.it=20(Postfix)=20wit h=20ESMTPS=20id=20321053C31E3=0D=0A=09for=20<talking@ml.linuxvar.i t>=3B=20Tue,=2016=20Jul=202013=2000:34:12=20+0200=20(CEST)|Authent ication-Results:=20linuxvar.it=3B=20dkim=3Dpass=20(1024-bit=20key= 3B=20insecure=20key)=0D=0A=09header.i=3D@inventati.org=3B=20dkim-a dsp=3Dpass|Received:=20from=20[82.94.249.234]=20(latitanza=20[82.9 4.249.234])=20(Authenticated=0D=0A=09sender:=20zoninoz@inventati.o rg)=20by=20localhost=20(Postfix)=20with=0D=0A=09ESMTPSA=20id=204C0 5498191=0D=0A=09for=20<talking@ml.linuxvar.it>=3B=20Mon,=2015=20Ju l=202013=2022:34:11=20+0000=20(UTC)|X-DKIM:=20Sendmail=20DKIM=20Fi lter=20v2.8.2=20latitanza.investici.org=204C05498191|DKIM-Signatur e:=20v=3D1=3B=20a=3Drsa-sha256=3B=20c=3Drelaxed/relaxed=3B=20d=3Di nventati.org=3B=0D=0A=09s=3Dstigmate=3B=20t=3D1373927651=3B=0D=0A= 09bh=3DL0lzQXxe9Rj1lRSw7hU53tv0dpn+kVOoAieknInM670=3D=3B=0D=0A=09h =3DDate:From:To:Subject:Message-ID:References:MIME-Version:=0D=0A= 09Content-Type:Content-Transfer-Encoding:In-Reply-To=3B=0D=0A=09b= 3DGHAyi1VQoM3at3XG+iRp+iZPoZNxzz4CFkh2pl0lcZMG/V2l6yWD7P9uboO4RtTK t=0D=0A=09Aajh566kdEZqNJ8bNkHEazeMkCpUgDDco5ydsbcP7jwMcFV5jf4iA6/d sG4xaQp93o=0D=0A=09xfG2tuFZ+dIfWrbJyOaJtzjBYDuN1hdcIh+8wQyQ=3D|Dat e:=20Tue,=2016=20Jul=202013=2000:38:07=20+0200|From:=20Gianluca=20 Zoni=20<zoninoz@inventati.org>|To:=20linux_var=20-=20LUG=20di=20Va rese=20e=20Provincia=20Mailing=20List=20<talking@ml.linuxvar.it>|R eferences:=20<51E467E6.4090000@gmail.com>|MIME-Version:=201.0|Cont ent-Disposition:=20inline|In-Reply-To:=20<51E467E6.4090000@gmail.c om>|X-Operating-System:=20"Linux=203.2.0-4-amd64=20-=20powered=20b y=20Debian"|X-Editor:=20GNU=20Emacs=2023.4.1|X-URL:=20http://inven tati.org/zoninoz|X-GPG-Keyserver:=20http://keyserver.linux.it:1137 1/pks/lookup?op=3Dvindex&fingerprint=3Don&search=3D0xFFB54463FD0AE E0A|X-GPG-Keynumber:=20FD0AEE0A|X-GPG-Fingerprint:=20C8D9=20AE3D=2 0DB20=20F198=205788=20=205018=20FFB5=204463=20FD0A=20EE0A|User-Age nt:=20Mutt/1.5.21=20(2010-09-15)|Subject:=20Re:=20[linux_var]=20ba sh=20capitolo=202|X-BeenThere:=20talking@ml.linuxvar.it|X-Mailman- Version:=202.1.13|Precedence:=20list|Reply-To:=20linux_var=20-=20L UG=20di=20Varese=20e=20Provincia=20Mailing=20List=0D=0A=09<talking @ml.linuxvar.it>|List-Id:=20linux_var=20-=20LUG=20di=20Varese=20e= 20Provincia=20Mailing=20List=0D=0A=09<talking.ml.linuxvar.it>|List -Unsubscribe:=20<http://ml.linuxvar.it/cgi-bin/mailman/options/tal king>,=0D=0A=09<mailto:talking-request@ml.linuxvar.it?subject=3Dun subscribe>|List-Archive:=20<http://ml.linuxvar.it/pipermail/talkin g>|List-Post:=20<mailto:talking@ml.linuxvar.it>|List-Help:=20<mail to:talking-request@ml.linuxvar.it?subject=3Dhelp>|List-Subscribe:= 20<http://ml.linuxvar.it/cgi-bin/mailman/listinfo/talking>,=0D=0A= 09<mailto:talking-request@ml.linuxvar.it?subject=3Dsubscribe>|Cont ent-Type:=20text/plain=3B=20charset=3D"iso-8859-1"|Content-Transfe r-Encoding:=20quoted-printable|Sender:=20talking-bounces@ml.linuxv ar.it|Errors-To:=20talking-bounces@ml.linuxvar.it; b=X5o9hsXXBy7IWA4RxiDYrG0LKXOwZWlpWvHEWSy97UHA6iLNGZETwB/yDjMT4Oh39 +0D/1SMJP5nySetGDJpcwWAw2UAE87DWKE4DLxzX/aIPuKWuoVY5/Nm1fZqmM6ViTz e8Zo/BxgyVboJMydsVS5f+4miCHY3dZ+Z44Twn9E=
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1373927651; bh=L0lzQXxe9Rj1lRSw7hU53tv0dpn+kVOoAieknInM670=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=GHAyi1VQoM3at3XG+iRp+iZPoZNxzz4CFkh2pl0lcZMG/V2l6yWD7P9uboO4RtTKt Aajh566kdEZqNJ8bNkHEazeMkCpUgDDco5ydsbcP7jwMcFV5jf4iA6/dsG4xaQp93o xfG2tuFZ+dIfWrbJyOaJtzjBYDuN1hdcIh+8wQyQ=
- In-reply-to: <51E467E6.4090000@gmail.com>
- List-archive: <http://ml.linuxvar.it/pipermail/talking>
- List-help: <mailto:talking-request@ml.linuxvar.it?subject=help>
- List-id: linux_var - LUG di Varese e Provincia Mailing List <talking.ml.linuxvar.it>
- List-post: <mailto:talking@ml.linuxvar.it>
- List-subscribe: <http://ml.linuxvar.it/cgi-bin/mailman/listinfo/talking>, <mailto:talking-request@ml.linuxvar.it?subject=subscribe>
- List-unsubscribe: <http://ml.linuxvar.it/cgi-bin/mailman/options/talking>, <mailto:talking-request@ml.linuxvar.it?subject=unsubscribe>
- References: <51E467E6.4090000@gmail.com>
- Reply-to: linux_var - LUG di Varese e Provincia Mailing List <talking@ml.linuxvar.it>
- Sender: talking-bounces@ml.linuxvar.it
- User-agent: Mutt/1.5.21 (2010-09-15)
On 150713, 23:21, Cristian Gaiatto wrote:
> Problemi con script bash seconda puntata.
> prendo la 2 riga di un file che contiene il nome dell'immagine che
> voglio aprire
>
> riga_disegno=$(sed -n 2p $nomefile)
>
> $nomefile è ricavato dalla parte precedente dello script
> ottenuto il nome dell'immagine passo il comando per aprirla
>
> xdg-open "/home/cristian/Immagini/$riga_disegno"
>
> apre il programma per la visualizzazione delle immagini ma non l'immagine.
> La variabile $riga_disegno è corretta (SM83162.jpg controllata con
> echo) e se da terminale do' il comando
>
> xdg-open "/home/cristian/Immagini/SM83162.jpg"
>
> mi apre correttamente l'immagine.
> Sbaglio qualche cosa?
>
> Cristian
sembra corretto (ho provato io stesso a fare la stessa cosa e funziona)
prova a fare un esperimento:
subito sotto:
riga_disegno=$(sed -n 2p $nomefile)
prova a scrivere:
file_disegno="${riga_disegno// }"
e poi usa la variabile $file_disegno per xdg-open
(eventualmente, controlla esattamente prima di xdg-open il valore della variabile, stampandolo nel modo seguente:)
echo "/home/cristian/Immagini/$file_disegno"
exit ## per terminare prima di xdg-open
xdg-open "/home/cristian/Immagini/$file_disegno"
--
Z O N I N O Z
Gianluca Zoni
zoninoz@inventati.org
http://inventati.org/zoninoz
http://savannah.gnu.org/users/zoninoz
_______________________________________________
Talking mailing list
Talking@ml.linuxvar.it
http://ml.linuxvar.it/cgi-bin/mailman/listinfo/talking