•aprilie 21, 2009 • Scrieti un comentariu

Mi-e dor de mine…

1,2,3…

•martie 30, 2009 • Scrieti un comentariu

Din seria de melodii bune cu versuri pe masura

3 Times And You Lose lyrics

I had a nightmare
I lived in a little town
where little dreams were broken
and words were seldom spoken

I tried to reach you
but all the lines were down
Summer rain began to fall
on this little town
…on this little town

The little people
have very little left to say
their words had all been shortened
they didn’t really seem important

And I had a feeling
that you were very far away
but a little voice inside me said
you’ll never get away from here

And it’s 1, 2,
3 Times and you lose
of course it doesn’t matter how you say it
I’m out of love
so there’s nothing really more to say
I’m throwing it all away

And we had a peeling
but now we all faked to see
we never look at one another
only when another suffered

And if I saw you
then it was just another face
but I still don’t blank horizon
lining on the human race

And it’s 1, 2,
3 Times and you lose
of course it doesn’t matter how you say it
I’m out of luck
so there’s nothing really more to say
I’m throwing it all away

And it’s 1, 2,
3 Times and you lose
I’m out of love
so there’s nothing really more to say
I’m throwing it all away
throwing it all away
throwing it all away

Model test SO

•martie 28, 2009 • Scrieti un comentariu

test exemplu so

1.

Scrieti comanda bash ce scrie in fisierul useri-escu.txt numele de cont ale tuturor utilizatorilor umani
din sistem al caror nume de cont se termina cu sufixul escu.

grep -a escu /etc/passwd >>useri-escu.txt
#-a=after, cuv specificat e dupa context
#>> redirecteaza iesirea standard spre un fisier

2.

Scrieti comanda bash ce arhiveaza toate fisierele cu extensia .c, .h sau .cpp, aflate in directorul dat
ca argument in linia de comanda sau in subdirectoarele acestuia, in arhiva surse-progs.tar.

find pttest \( -name \*.c -o -name \*.h -o -name \*.cpp \) && tar -cf surse-progs.tar pttest

#cauta in directoul pttest fiserele care au in nume .c sau .h sau .cpp si apoi le arhiveaza in
#surse-progs.tar

3.

Fie scriptul urmator, care se va apela cu o serie de parametri in linia de comanda:

#!/bin/noshell
A=1; #B=0;
for a in $(ls /bin/*)
do
[ -d $a ] && let B++
done
echo #B, $A

Explicati ce se va afisa pe ecran in urma executiei scriptului. Corectati eventualele erori existente
astfel incat in urma executiei scriptului corectat sa apara afisate pe ecran numarul
subdirectoarelor din directorul /bin si numarul parametrilor cu care a fost apelat.

noshell is a shell that can be used for system users which need to be active but should never be used
to log in to the system. noshell monitors attempts to access disabled accounts and logs this into syslog.

This program is designed to provide the system administrator with additional information about who is
logging into disabled accounts.

Noshell provides an informative alternative to this method by specifying the noshell program as the
login shell in the password entry for any account which has been disabled.

scriptul initial nu va afisa nimic!
# marcheaza un comentariu intr-un script

scriptul corectat:

#!/bin/bash folosim shell-ul bash
A=0; # initializam parametrul in care vom numara variabilele de la consola
B=0; #initializam parametrul in care vom numara subdirectoarele
for parametru in $@ #parcurgem cu un for variabilele de la consola
do
let A++ #incrementam A
done #incheiem for
for a in $(ls /bin/*) #parcurgem recursiv toate subdir lui bin (ls *)
do
let B++ #incrementam B
done
echo $B, $A #afisam cele 2 variabile

varianta2:

#!/bin/bash
B=0;
for a in $(ls /bin/*)
do
let B++
done
echo $B, $# # $#=numarul parametrilor din linia de apel

Linux (is) fun

•martie 28, 2009 • Scrieti un comentariu

(daca tot ne amuzam)
Exista sh(Bourne SHell) si bash(Bourne Again SHell)- care intre noi fie vorba ne va manca zilele pana sambata.M-a amuzat ca ultimul nume suna a “i’ll be back” :d.

Asa..si a doua, daca incercam sa arhivam ceva fara a specifica ce vom primi eroarea

tar: Cowardly refusing to create an empty archive