Home
Flashcards
Preview
script
Home
Get App
Take Quiz
Create
why do scripting
automated maintenance
automated reports
schedule when needed
What kind of command language
interpreted command language
How many shell script UNIX commands to preform a task
It can contain multiple commands
An executable premission and is in the path name. What do you write at the command prompt
$ myfile
If it had executable permission and is not in the path name, how do you specify the path
$ ./myfile
It does not have executable permission
$ sh myfile
To make it an executable file
for everyone
a
for the owner
u
for the group
g
others outside the group
o
File permissions
read
r
write
w
execute
x
none
-
permissions can be
added
+
denied
-
explicitly set
=
to view current permissions
ls -l
to change premissions
chmod
All programs including scripts can be written using a combination of 3 structures.
Sequence
execute the commands in order
selection
if then or if then else statements
test for a criteria
looping
repeat a set of instructions, until the criteria is met and number of times
cat -n
the files with line numbers
in the file what does this mean #
Its a comment line and not executed
what does command display
date
current date and time
pwd
current working directory
wc
count words lines and characters
cp
copy a file
echo"any text"
displays the info after the echo
echo "no text"
makes blank line
read var1 [var2 var3]
accepts the keyboard data and places it in one or more
variables
how to use data in a variable
$var1
exit[number]
end of the program and stop it
can assign error code of 0 means successful
what is a variable
a memory location that has a name and stores a piece of data called a value
can store text, number or other type of data
can a variable be changed in a script as it runs
yes
what is iggnored by unix
#
Run the script and save the data in a file, overwriting any data already in the file
$ sh won3> capturefile
•Run the script and save the data in a file, appending the data at the end of any data already in the file
$ sh won3>> capturefile
•Run the script, display the data to the screen and save the data in a file, overwriting any data already in the file
$ sh won3 | tee capturefile
when running $ sh box 10 20 each is assigned a variable number
$ is value box
$1 is vlue 10
reads commands but doesn’t execute them
sh -n
shows the shell input lines as they are read
sh -v
shows the commands and their arguments as they are executed
sh -x
Author
Tjr31
ID
52560
Card Set
script
Description
part 1
Updated
2010-12-01T04:27:38Z
Home
Flashcards
Preview