Swapping values of two variables Shell Programming | os | 4th sem cse | operating system lab | QT

Поделиться
HTML-код
  • Опубликовано: 7 окт 2024
  • ********** Welcome to Our RUclips Channel *************
    operating system laboratory for cse engineering playlist
    • Operating System
    Exp. No. 4 Swapping values of two variables Shell Programming
    Aim
    To write simple shell scripts using shell programming fundamentals.
    The activities of a shell are not restricted to command interpretation alone. The shell
    also has rudimentary programming features. Shell programs are stored in a file (with
    extension .sh). Shell programs run in interpretive mode. The original UNIX came with the
    Bourne shell (sh) and it is universal even today. C shell (csh) and Korn shell (ksh) are also
    widely used. Linux offers Bash shell (bash) as a superior alternative to Bourne shell.
    program:-
    A) Swapping values of two variables
    Swapping values - swap.sh
    echo -n "Enter value for A : "
    read a
    echo -n "Enter value for B : "
    read b
    t=$a
    a=$b
    b=$t
    echo "Values after Swapping"
    echo "A Value is $a and B Value is $b"

Комментарии •