Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ex de la lab2 OS
- #ex1
- /bin/bash
- contor=$# #fara spatiu!!! numarul de argumente cu care a fost apelat fisierul de comenzi curent
- cmd=echo #cmd ia val stringului echo
- while test $contor -gt 0 #while contor > 0
- do
- cmd="$cmd \$$contor"
- contor=`expr $contor - 1`
- done
- eval $cmd
- #--------------------------------------
- #ex2
- #!/bin/bash
- var=`ls`
- contor=1
- for i IN $var
- do
- echo "$contor $i"
- contor=`expr $contor + 1`
- done
- #----------------------------------------
- #ex3
- #!/bin/bash
- var=`ls $1`
- contor=1
- for i IN $var
- do
- echo "$contor $i "
- contor=`expr $contor + 1`
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement