Let me see if I understand what you're doing. You have a script that is given an operand that is the name of the directory to be removed. You expect it to be invoked with something like:
and you have written removeall to be:
And, if the person who invokes removeall forgets to give an operand, bad things happen.
So, why did your script add /*??? If the script had been:
you would get the same results when a directory operand is given, but you wouldn't have a problem when no operand is given (rm would just print a diagnostic saying no operands were given or an empty string is not a valid pathname).
Or your script could actually check for missing or "invalid" operands:
UNIX utilities are there to help you get a job done. If you use them correctly, they can do wonderful things for you. If you tell them to do stupid things, you'll get what you asked for.
I am using bash shell; my requirement is to run a long command.
Now I have split this long command into a number of shell variables.
Some of these shell variables contain special character ':'
At the end, when the intended long command is executed as a series of small shell variables the ':'... (7 Replies)
Is there anyway to prevent a command from being logged in the history file?
I share a system with others (log in with same account) and I would like to prevent any passwords from being logged in the history file. Some of the commands that I run require username/password on the command line... (7 Replies)
I am using linux termios structure to configure serial port and read the port by read function. For some reason, if I read the whole buffer, almost every time the buffer does not contain the correct reply message sequence from a device sending reply to my linux PC. So I use... (5 Replies)
I have one shell script which is being accessed by many jobs at same time.
I want to make the script such that , other job should wait for the script if script is being used by some other job. Is there any way to implement it in script level ?
Gops (1 Reply)
I understand that on my HP-UX 11.31 system when print queues can no longer communicate with remote printers, the queue disables itself. How can I configure it to stop disabling itself, or alternatively, to re-enable itself when the remote printer comes back online? I have users in warehouses who... (6 Replies)
Hi,all.Well,I know someone has already asked this question before,however,It's too long before.So i post a new thread here.
Here is the issue.I have a shell script that use awk to calculate something and the script takes about 15 mins,it will use 100% CPU,and the system automatically killed the... (2 Replies)
Hi,
I've been searching around for solution, hope that some gurus here can help.
I'm using some commands in my shell script and I'd like to protect these command to be moved to another directory. For instance, cp currently in /bin/cp. If I move it to /bin/cpxxx, my script will not be able to... (3 Replies)
If an email is sent from our application server(running on AIX) to an id that is outside of the organization like gmail etc, and if gmail should not treat the mail as spam, what has to be done from unix level? (7 Replies)
Discussion started by: ggayathri
7 Replies
LEARN ABOUT FREEBSD
introduction
INTRO(1) BSD General Commands Manual INTRO(1)NAME
intro -- introduction to general commands (tools and utilities)
DESCRIPTION
Section one of the manual contains most of the commands which comprise the BSD user environment. Some of the commands included in section
one are text editors, command shell interpreters, searching and sorting tools, file manipulation commands, system status commands, remote
file copy commands, mail commands, compilers and compiler tools, formatted output tools, and line printer commands.
All commands set a status value upon exit which may be tested to see if the command completed normally. Traditionally, the value 0 signifies
successful completion of the command, while a value >0 indicates an error. Some commands attempt to describe the nature of the failure by
using exit codes as defined in sysexits(3), while others simply set the status to an arbitrary value >0 (typically 1).
SEE ALSO apropos(1), man(1), intro(2), intro(3), sysexits(3), intro(4), intro(5), intro(6), intro(7), security(7), intro(8), intro(9)
Tutorials in the UNIX User's Manual Supplementary Documents.
HISTORY
The intro manual page appeared in Version 6 AT&T UNIX.
BSD October 21, 2001 BSD