01-03-2008
This is how my program looks can you please tell me why i am getting errors when i run the script as
$./sandeep.sh
./sandeep_new.sh: line 12: read: `dir?what is the path that you want to find ?': not a valid identifier
./sandeep_new.sh: line 13: read: `dir?Please specify a valid path to search ?': not a valid identifier
./sandeep_new.sh: line 23: syntax error near unexpected token `else'
./sandeep_new.sh: line 23: `else'
#!/bin/ksh
NULL=""; export NULL #If the user specifies NULL value
echo "The cvs file script has started............................................"
read dir?"what is the path that you want to find ?"
read dir?"Please specify a valid path to search ?"
if [ "$dir" = "$NULL" ]; then
echo "Not a Valid path or path not specified by user,Do you wish to continue:"[Y/N]?""
read ans
case "$ans" in
y*|Y*)
read log?"Please specify a valid log file(ex:/logs/sandeep.log) that needs to created that will dump the results on the log file ?"
else
n*|N*)
echo exiting from program...;;
esac
if [ "$log" == "$NULL" ]; then
echo "Not a Valid path or path not specified by user,Do you wish to continue:"[Y/N]?""
read ans
case "$ans" in
y*|Y*)
read days?"Please specify the valid number as the number of days for the serach ?"
if [ "$days" == "$NULL" ]; then
echo "Not a Valid path or path not specified by user,Do you wish to continue:"[Y/N]?""
read ans
case "$ans" in
y*|Y*)
find $dir -ctime +$days -type f -exec ls -l {} \; > $log
else
n*|N*)
echo exiting from program...;;
esac
fi
fi
fi
exit
Last edited by bsandeep_80; 01-03-2008 at 07:22 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
am a new learner to shell programming.
i have a script which will prompt for user to key in their name & display their name afterwards.
script
=====
echo "Pls enter your name:"
read name
echo "Your name is $name."
output
=====
Pls enter your name:
Bob
Your name is Bob.
what... (2 Replies)
Discussion started by: newbie168
2 Replies
2. UNIX for Dummies Questions & Answers
What is the command to find the path of a file if we know the file name and the root directory where the file resides..
For eg. if a file abc.dat resides in /home/mydir/myfiles/. I am looking for a command which will be fired from / directory, takes abc.dat as input and display the path of... (3 Replies)
Discussion started by: abhilashnair
3 Replies
3. UNIX for Dummies Questions & Answers
I'm trying to autogenerate a PATH variable from the output of a find command as follows:
PATH=`find $dir -name "*.jar" | sed 's/$/:/'`
The output looks similar like this if I echo it:
PATH=/path/to/1.jar:
/path/to/2.jar:
/path/to/3.jar:
I want the path to be on one line.
I'm on... (3 Replies)
Discussion started by: rein
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script.
I am planning to do like this:
if ; then... (2 Replies)
Discussion started by: new_learner
2 Replies
5. AIX
How to find the status of SAN Disc through command prompt (1 Reply)
Discussion started by: AIXlearner
1 Replies
6. UNIX for Dummies Questions & Answers
i understand by using the pwd command we get the present working directory.
which command is used to find absolute path from home directory to root..
What is absolute path to your and root user's home directory.:confused::confused::confused: (2 Replies)
Discussion started by: shaziafathima
2 Replies
7. UNIX for Advanced & Expert Users
Hi,
While typing the Unix command, entire command is not visible.When the input command is long, it is not visible. I want the entire command to be displayed when i type it. Please help to resolve this issue.
Thanks
Sampath (7 Replies)
Discussion started by: sampath.giri
7 Replies
8. Shell Programming and Scripting
I have a script built that takes the standard inputs $1 $2 $3 after the name and parses some data.
hexsite=`echo "obase=16;$1"|bc`
hexfix=$(printf "%.3X" 0x$hexsite)
if || ;then
type=33
elif || ;then
type=59
elif ;then
type=99
else type=00
fi
cat /directory/*.2012$3*|
I am... (8 Replies)
Discussion started by: PCGameGuy
8 Replies
9. Red Hat
Hi guys. I want to know the path of a command. I tried "which" command also . But no luck.
Please tell me how to find and update the correct path of the command.
Here I'm unable to find the path of ext2online command
# resize2fs /dev/vg01/lvora_backup
resize2fs 1.39 (29-May-2006)... (3 Replies)
Discussion started by: vamshigvk475
3 Replies
10. Red Hat
Hi Folks,
I want to run the below command and to exclude the specific path like /var/test/support/... . How to achieve using the below command
find / -type f \( –perm –4000 –o –perm –2000 \) –print
-Siva
Please do not use FONT tags inside CODE tags. And, there is usually no reason to... (2 Replies)
Discussion started by: gsiva
2 Replies
kits(1) General Commands Manual kits(1)
Name
kits - generate setld format distribution kits
Syntax
/usr/sys/dist/kits key-file input-path output-path [ subset... ]
Description
The command produces subset images, inventories, and control files for an installation using the command. You need to know the key file
which describes the product to be built, a hierarchy from which the component files to be kitted are to be taken, and a destination direc-
tory into which the kit information is to be placed.
The command produces a subset image and a .image file in the output-path directory for each subset. In the instctrl subdirectory of output-
path, produces an inventory file and a control file. Any subset control program for the subset is transferred to output-path/instctrl. An
instctrl directory is created if none existed.
Arguments
key-file The path name of the manufacturing key file which describes the product to be kitted. Unless optional subset arguments are
specified, all subsets listed in the descriptor section of the key-file are kitted.
input-path The path name which specifies the top of a hierarchy of files. This hierarchy contains the files which are to be kitted into
subsets.
output-path The name of the directory to be used to store the subset image and data files produced by the command.
subset... The names of individual subsets can be specified by optionally listing them on the command line. If they are specified, only
those subsets will be kitted. The program assumes that all other subsets for the product have been kitted and that their
images are in the directory specified by output-path. The key file specified must contain descriptors for each of the
optional named subsets.
Restrictions
Any subset control programs to be provided with the kit must be located in a directory scps in the working directory where the program is
invoked. If no subset control program is found for a subset, an empty one is created.
Examples
The following example shows the command used to produce a kit using key file ULT400.k in the current directory to package files from the
hierarchy /var/kits/input and place the results in /var/kits/output.
kits ULT400.k /var/kits/input /var/kits/output
The next example shows the same usage, but specifies that only the ULTACCT400 subset is to be created.
kits ULT400.k /var/kits/input /var/kits/output ULTACCT400
Diagnostics
kits: key-file not found
The program was unable to find the key-file specified on the command line.
kits: input-path not found
The program was unable to find the specified input-path.
kits: output-path not found
The program was unable to find the specified output-path.
kits: cannot create instctrl directory.
The program cannot create an instctrl directory under output-path. Check that the user has write permission to output-path.
kits: key-file format error
One of the NAME, CODE, VERS, MI or ROOT values in the specified key-file is either missing or has a null value.
Inventory file pathname not found
The master inventory file pathname specified in the MI entry of the key-file cannot be found. Verify that the pathname is accessible from
the current directory.
Generating media creation information...failed.
There are no records in the master inventory file for a subset which is being kitted. Check the master inventory file for correctness of
content and format.
No such subset in key-file subset subset
A subset name specified on the command line does not have a descriptor line in the key-file. Check the spelling of the subset name on the
command line. Check the contents of the key-file.
compression failed. status = status
The compression option was specified in the key-file and an attempt to compress a subset failed. This should not happen. Run the program
once more.
Files
temporary files.
log of subset packaging activity
See Also
invcutter(1), tarsets(1), stl_comp(5), stl_ctrl(5), stl_image(5), stl_key(5), stl_mi(5), stl_scp(5), setld(8)
Guide to Preparing Software for Distribution on ULTRIX Systems
kits(1)