shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subst simples com sed nao funfa


From: Elton
Subject: subst simples com sed nao funfa
Date: Tue, 13 Jul 2004 22:05:05 -0300
User-agent: KMail/1.4.3

Ola a todos,

nao estou entendendo pq isso aki embaixo nao esta funcionando nem a porrete, 
alguem pode me dar uma dica?

----------------------
    # Pegando o mac address
    macint=`/sbin/ifconfig|head -1`
    mac=`echo ${macint:$((${#macint}-19)):$((${#macint}))}`

    #pegando o path do sendmail
    psendmail=`which sendmail`

    cat $cgi/.wprofile | sed -e"s/XMACADDRESS/${mac}/" > $cgi/.wprofile.new && 
mv .wprofile.new .wprofile
    cat $cgi/.wprofile | sed -e"s/XPATHSENDMAIL/${psendmail}/" > 
$cgi/.wprofile.new && mv .wprofile.new .wprofile
-------------------------------

retorna++ /sbin/ifconfig
++ head -1
+ macint=eth0       Encapsulamento do Link: Ethernet  Endereço de HW 
00:E0:7D:92:6A:F8
++ echo 00:E0:7D:92:6A:F8
+ mac=00:E0:7D:92:6A:F8
++ which sendmail
+ psendmail=/usr/local/bin/sendmail
+ cat /opt/gr5/cgi/.wprofile
+ sed -ey/XMACADDRESS/00:E0:7D:92:6A:F8/
sed: -e expression #1, char 26: Extra characters after command
+ cat /opt/gr5/cgi/.wprofile
+ sed -ey/XPATHSENDMAIL//usr/local/bin/sendmail/
sed: -e expression #1, char 17: strings for y command are different lengths



-- 

[]'s
Elton 
esbaptista em yahoo com br
esbaptista em fastmail fm

uin 153513488 
Linux User #198105 - http://counter.li.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]