alexarcan

lab2OS

Oct 7th, 2015
507
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ex de la lab2 OS
  2. #ex1
  3.  
  4. /bin/bash
  5. contor=$#  #fara spatiu!!! numarul de argumente cu care a fost apelat fisierul de comenzi curent
  6. cmd=echo #cmd ia val stringului echo
  7. while test $contor -gt 0 #while contor > 0
  8. do
  9. cmd="$cmd \$$contor"
  10. contor=`expr $contor - 1`
  11. done
  12. eval $cmd
  13.  
  14.  
  15. #--------------------------------------
  16.  
  17. #ex2
  18.  
  19. #!/bin/bash
  20. var=`ls`
  21. contor=1
  22. for i IN $var
  23. do
  24. echo  "$contor $i"
  25. contor=`expr $contor + 1`
  26. done
  27.  
  28. #----------------------------------------
  29.  
  30. #ex3
  31.  
  32. #!/bin/bash
  33. var=`ls $1`
  34. contor=1
  35. for i IN $var
  36. do
  37. echo  "$contor $i "
  38. contor=`expr $contor + 1`
  39. done
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×