Using an editor or the cat command, write a script that uses a variable. Note that this script uses the bash shell on LINUX, but you can also use the ksh shell with UNIX.
1) Set a value for the variable first using typeset then check it using set.
[root@vmpc_rh804 root]# typeset first=you
[root@vmpc_rh804 root]# set | more
BASH=/bin/bash
BASH_ENV=/root/.bashrc
BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i686-pc-linu
x-gnu")
BASH_VERSION='2.05b.0(1)-release'
COLORS=/etc/DIR_COLORS
.
.
.
first=you
hi=hello
langfile=/root/.i18n
2) Write a short Welcome script that uses a variable.
[root@vmpc_rh804 root]# cat > Welcome.bash
#!/bin/bash
#
first=Student
echo "Welcome to Linux $first"
Ctrl/D
3) Execute your script using the shell interpreter.
$ bash Welcome.bash
Welcome to Linux Student
Nvidia new hotplug feature on Linux
-
If you use nvidia driver for your GPU, you probably wonder why in some
config, you can't hotplug your second monitor. You need to reboot to be
able to ...
10 months ago


No comments:
Post a Comment