1.Write a shell script to print below pattern 0 0 1 0 1 2 0 1 2 3

 #!/bin/bash


# Loop to generate the pattern

for i in {0..3}; do

    for j in $(seq 0 $i); do

        echo -n "$j "

    done

    echo ""  # Move to the next line

done


Comments

Popular posts from this blog

10.Write a shell script to count the number words,lines,character from given file accept file name from commandline.

2.Write a shell script to compile all C files and delete those files having errors.