10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In one of my shell function I found the following
set_default_values () {
prog=$1
PROC_DT=$2
RESET_ALL="${3-N}"
#echo "Processing date as passed = , Program name = "
......
I understand the first and second arguments, but don't understand... (1 Reply)
Discussion started by: digioleg54
1 Replies
2. Shell Programming and Scripting
Hi,
Is there any way that we can pass one file as one of the argument in shell script ? (1 Reply)
Discussion started by: Selva_2507
1 Replies
3. Shell Programming and Scripting
Hi,
I have a requirement to work on script, it should take either of arguments.
wrote it as below.
#!/bin/bash
usage() {
echo "$0: missing argument OR invalid option !
Usage : $0 -m|-r|-d
}
while getopts mrdvh opt; do
case "$opt" in
m) monitor_flag=monitor;;... (1 Reply)
Discussion started by: ramanaraoeee
1 Replies
4. Shell Programming and Scripting
Hi I am new in shell,
I am trying to create a small script that can do exit if a script is executed when argument not 2
#!/bin/sh
if ; then
echo greater
exit 1;
elif ; then
echo less
exit 1;
fiit keeps returning me
whatever number of argument I... (1 Reply)
Discussion started by: peuceul
1 Replies
5. UNIX for Dummies Questions & Answers
#!/bin/bash
echo "enter a file or directory name"
read name
if
then
echo " argument is file "
ls -l $name | awk '{print $1,}'
elif
echo " argument is a directory"
ls -l $name | awk '{print $1}'
fi
what i am trying to do. get input... (3 Replies)
Discussion started by: iluvsushi
3 Replies
6. Shell Programming and Scripting
Hi All,
I have a script which accepts a parameter which can either be blank, a specific value, or a wildcard value. But it never seems to be blank and the wildcard option seems to return the names of matching files in my directory. This happens even with the worlds simplest script that just... (1 Reply)
Discussion started by: cdines
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
If not running a shell script file in current shell (. ./fileName) then $0 represents the executable file name. But in case of invoking shell script file in current shell then i m getting "$0 as -bash" . In such case how can i get the program name (running shell script file name)?
Thanks, (2 Replies)
Discussion started by: painulyarun
2 Replies
8. Shell Programming and Scripting
All,
I am having a shell script and i will pass different argument diferent time . Please tell me how can i find the last argument that i passsed each time when i exec the script.
Thanks,
Arun. (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
9. Shell Programming and Scripting
Trying to tar specific files from a directory causes problems when the number of files is too large.
ls ~/logs | wc -l
5928
In the logs directory - I have 5928 files
If I want to include all files with today's date - I run the following command
tar cf ~/archive/LoadLogs_20060302.tar... (8 Replies)
Discussion started by: dad5119
8 Replies
10. Shell Programming and Scripting
how to parse the command line argument to look for '@' sign and the following with '.'.
In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format.
rmjoe123@hotmail.com has '@' sign and followed by a '.'
to be more... (1 Reply)
Discussion started by: rmjoe
1 Replies