J'ai un soucis avec une commande externe... la voici :
Mon bash l'éxécute (déjà ça ) à sa façon.....
Je me retrouve avec non pas 3 dossiers lol, not et glop. Mais les dossiers : lol?, not? et glop (oui ! un de bon !!!!!). Et, une erreur sur le sleep : sleep invalid interval '2\r'
Oh oh, mais que vois-je ? un retour de ligne ?!
Bon, certe j'ai sauté des lignes, mais c'est pour aérer... Je ne suis pas obligée de tout mettre sur la même ligne dans un fichier de commande externe ? non ? si ??? (j'en suis à mon 4eme jour de unix >_< .... pardonnez ma noob'attitude)
Bon, j'ai créé mon fichier avec notepad (j'utilise cygwin, donc j'édite mes fichiers par confort via note-pad). Mais, je l'ai tout réécrit après ça avec vi !
Et kif kif bourricot !
Arg.... Ca m'a déjà bouffé 2-3 bonnes heures.... Des idées ???
Ok I just understand that this forum is an englishone and what I was seeing was a translation.. I'm the dumbest....
So, my problem is, whith this command I get 3 folders, 2 with a ? at the end, and one without it. And, thanks to the sleep command, I realise that my bash add a \r to the end of each line...
1) Stop editing your scripts in Notepad. Create them inside the shell with an editor like nano or vim.
2) tr -d '\r' < oldscript > newscript
3) To delete a dir with a weird name, something like find ./ -iname 'lol*' -type d -exec rmdir '{}' ';'
As you realize also vi is your friend not notepad...
You could give a try to see if you have dos2ux (dos2unix depending of flavours...) installed and convert your script file...
but the best is to edit it with vi and see the content!
Hello,
I want to know how i can sum two numbers in a grep command with the parameter -n.
this code return line number and the line who have the "pattern" :
*\).*/\1/p')
]
but now i want to suw *\).*/\1/p')] with 1 to have the next line:
*\).*/\1/p')] + 1 : it can't work.
Thanks you (4 Replies)
Hello !
I use mailx to send emails.
I use it like that
mailx -s $titleMail $mailAdr < BODY_MAIL.txt
The problem , is if i have some spaces in the variable titleMail it is
considered by the command mailx like other mail adress to send the mail.
Anyone would have a suggestion... (1 Reply)
Hi everybody
I m looking the put the result of a commande to a Variable
i explain
here is my command:
cat sortie | grep "^"| awk '{ print $1}'
15
sortie is a text file
I want to put the result of command in a variable X
and the end i would like
echo $X
15 (3 Replies)