10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
We have few scripts where we are using grep -w option to do exact matching of the pattern. This works fine on most of our servers.
But I have encounter a very old HP-UX System(HP-UX B.11.00) where grep -w option is not available.
This is causing my scripts to fail. I need to change... (7 Replies)
Discussion started by: veeresh_15
7 Replies
2. Shell Programming and Scripting
I am trying to code for the addition of a new argument to the command line, the option D to a code that already has ABC (below). When I use make to compile it, it displays: invalid option --D. I did define the global d variable, as well as initialized it inside the main function of the C code. I... (9 Replies)
Discussion started by: Alabama
9 Replies
3. Shell Programming and Scripting
What is the significance of the *) and ?) in the below code.
while getopts a:b:c:he opt
do
case $opt in
a) _name="$OPTARG";;
b) _project="$OPTARG";;
c) line="$OPTARG";;
e) _cmd="XX";;
h) Projects=1;;
*) echo "$OPTARG is an invalid option";
my_exit 1;;
?)... (3 Replies)
Discussion started by: posix
3 Replies
4. Shell Programming and Scripting
To find all the files in your home directory that have been edited in some way since the last tar file, use this command:
find . -newer backup.tar.gz
Is anyone familiar with an older solution?
looking to identify files older then 15mins across several directories.
thanks,
manny (2 Replies)
Discussion started by: mr_manny
2 Replies
5. UNIX for Dummies Questions & Answers
Hi
I need to use getopt option and I have no idea what it is or how to use it.
I need to use it on this awk script:
awk -F, -v cellid="$1" -v paramval="$2" -v oldfile="$3" -v newfile="$4" '$2==cellid{$3=newvalue}1' OFS="," $3 > $4
I tried reading up on it but I just confuse... (2 Replies)
Discussion started by: ladyAnne
2 Replies
6. Shell Programming and Scripting
Hello,
I am processing a text file which contains only words with few combination of characters (it is a dictionary file).
example:
havana
have
haven
haven't
havilland
havoc
Is there a way to exclude only 1 to 8 character long words which not include space or special characters : '-`~.. so... (5 Replies)
Discussion started by: alekkz
5 Replies
7. Shell Programming and Scripting
:)
Can anybody help me about how to use getopt in shell scripting. (3 Replies)
Discussion started by: darshakraut
3 Replies
8. Shell Programming and Scripting
I m trying to use getopt
This is my script, but it doesn't take argument in variable,
Please help.
set - - `getopt mscl: $*`
if
then
echo "Exiting...."
exit 2
fi
for i in $*
do
case $i in
-m) MAIL="$i"; shift;;
-s) SCRIPT=$OPTARG; shift;;
-c) COB=$OPTARG; shift;;... (2 Replies)
Discussion started by: darshakraut
2 Replies
9. Shell Programming and Scripting
Hi all,
I am parsing command line options using getopts.
The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument.
Below is the script:
while getopts :hd:t:s:l:p:f: opt
do
case "$opt" in
-h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies
10. Shell Programming and Scripting
#!/bin/sh
set -- `getopt "abco:" "$@"`
a= b= c= o=
while :
do
case "$1" in
-a) a=1;;
-b) b=1;;
-c) c=1;;
-o) shift; o="$1";;
--) break;;
esac
shift
done
shift # get rid of --
# rest of script...
# e.g.
ls -l $@ (6 Replies)
Discussion started by: Hitori
6 Replies