Shell Scripting Tutorial for Beginners - Part 2 || Variables

preview_player
Показать описание
In this video, we'll be learning how to use variables in shell scripting in Linux. We'll be creating a simple shell script to print the contents of a file.

If you're new to shell scripting, or if you're just looking to learn more about variables, then this is the video for you! In this video, we'll be learning how to use variables, and how they can help you write more efficient shell scripts in Linux. We'll also be looking at some examples of how to use variables in shell scripts, so you can see how they can be used to achieve specific goals.

In this video we discuss the the use of variables in shell script. Variables in shell scripting are of two types:
1. Local Variables
2. Environmental variables

Other Playlist on this channel:

#shellscript #linux #linuxessentials #variables #dextutor
Рекомендации по теме
Комментарии
Автор

done sir
echo "enter your file"

read old
read new
mv $old $new
echo "done"
ls

sudeepsirisetti
Автор

Can we get the list of all environmental variables which are predefined??

sinkypriya
Автор

thnx for this vdo sir ans is
#!/bin/bash
echo "write name of file which u want to rename"
read old
read new
mv $old $new
echo "file is renamed it"

gouravkadyan
Автор

if there is another way than plz tell me sir

gouravkadyan
Автор

i give space sir there is no empty lines

sudeepsirisetti
Автор

#!/bin/bash

#prompt user for directory names
echo "Enter the names of directories "
read dir1 dir2

if [ -e $dir1 ] && [ -e $dir2 ]
then
echo "Error: Dirs $dir1 and $dir2 already exists"
else
mkdir $dir1 $dir2
echo "The two directories $dir1 and $dir2 created successfully"
fi

harunaadoga
Автор

echo "enter your file"

read old
read new
touch $old
mv $old $new
echo "done"
ls $new

TabotVickram
Автор

#!/bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color

echo -e "${RED}Change the name of a file${NC}"
echo "Enter the name of the old file you want to rename"
read oldfile

echo "Name of the new file (no space)"
read newfile
mv $oldfile $newfile
echo "File name updated"

CJlmages