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

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

Re: RES: [shell-script] debbug


From: caio ferreira
Subject: Re: RES: [shell-script] debbug
Date: Thu, 12 Aug 2004 14:32:37 -0300
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

Claudia Couto Mello - IMAGO - Claro RJ - wrote:
        Por acaso alguem saberia me dizer se existe algum software para
fazer debug de um shell-script ?!?!? Eh que eu estou com um problema em um 
script que nao
ha meio de conseguir resolver.

> Coloca echo em cada linha depois de alguma saida e vc assim vai acompanhando
> o andamento do programa

        O comando que eu estou querendo verificar eh o seguinte :

        sed "s|::|:${PASSWORD}:|" $USERSFILE > arquivo-novo

Se por acaso eu coloco o comando echo no comando acima aparecem as seguintes mensagens de erro :

akira:~/scripts/users# sh teste.sh
teste.sh: line 13: ::: command not found
teste.sh: line 13: :okxf4o87:: command not found
teste.sh: line 13:  teste.db > arquivo-novo: command not found
teste.sh: line 13: ::: command not found
teste.sh: line 13: :a1ajlytv:: command not found
teste.sh: line 13:  teste.db > arquivo-novo: command not found


#!/bin/bash
# Declarando variaveis
WORKDIR=/root/scripts/users
HOMEDIR=/home
USERSFILE=teste.db
CUT=/usr/bin/cut

# for each user listed
for EACHUSER in `grep -v "#" $WORKDIR/$USERSFILE` ; do

  # garar senha
  PASSWORD=$(makepasswd --chars 8 --string abcdefghijklmnopqrstuvwxyz1234567890)

  sed "s|::|:${PASSWORD}:|" $USERSFILE > arquivo-novo

done


reply via email to

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