Sponsored Content
Top Forums UNIX for Dummies Questions & Answers help with shell scripting argument Post 302472273 by DGPickett on Tuesday 16th of November 2010 05:02:15 PM
Old 11-16-2010
see man test or man ksh for [...]. There is -d for direcotry, -l for link, -L for something else to do with links? A valid path can also be a named pipe, a raw or cooked device, etc. You can also do
Code:
 
ls -ld $name | read ls
case "$ls" in
(d*)
   echo " argument is a directory" >&2
   ls -l $name
   ;;
(-*)
   echo " argument is file " >&2
   echo "$ls"
   ;;
(*)
   echo "Not a file or directory: $ls" >&2
   ;;
esac | awk '{print $1}'

This User Gave Thanks to DGPickett For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script argument parsing

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

2. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

3. Shell Programming and Scripting

printing last argument in shell script

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

4. UNIX for Dummies Questions & Answers

Very simple argument in scripting question

I tried to do a search, but it couldnt pinpoint what my answer since using limited but broad keywords. Sorry in advance ; ; Im limited to using Bourne shell scripting only, atm I have the following code (just the heading part of it) ... ... # VARIABLE DECLARATION # ==================== ... (2 Replies)
Discussion started by: eeto
2 Replies

5. UNIX for Dummies Questions & Answers

Shell script $0 argument

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

6. Shell Programming and Scripting

Shell argument

I need to create a Kash script that will read two arguments. So if the user enters anything but 2 arguments then they will get and error message. If they enter the two arguments then it will print them out in reverse order. Does anyone know how i can do this? (7 Replies)
Discussion started by: vthokiefan
7 Replies

7. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

8. Shell Programming and Scripting

how to specify number of argument in shell

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

9. Shell Programming and Scripting

passing either of argument, not both in shell

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

10. Shell Programming and Scripting

Expect Scripting Loop Argument Desperately Needed!

I am trying to create an Expect script that does the following: 1) Telnets to an IP address and logs in with user ID and Password 2) Issue a CLI command to the server that will output data of which I am particularly interested in a DS1 clock 'Slips' value. I want to be able to keep issuing... (0 Replies)
Discussion started by: dwightlaidler
0 Replies
asadmin-start-appserv(1AS)					   User Commands					asadmin-start-appserv(1AS)

NAME
asadmin-start-appserv, start-appserv - starts thedomains in the specified or default domains directory SYNOPSIS
start-appserv [--domaindir install_dir/domains] [--terse=false] [--echo=false] DESCRIPTION
This command has been deprecated. Please use start-domain to start the domains in the specified or default domains directory. start-appserv starts the domains in the specified or default domains direcotry. If the domains directory is not specified, the domains in the default domains directory are started. The default domains directory is install_dir/domains. This command can only be run locally. OPTIONS
--domaindir directory where the domains are started. If specified, path must be accessible in the filesystem. If not specified, the domains are started in the default install_dir/domains directory. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-domain(1AS), asadmin-start-domain(1AS), asadmin-stop-domain(1AS), asadmin-delete-domain(1AS), asadmin-list-domains(1AS) J2EE 1.4 SDK March 2004 asadmin-start-appserv(1AS)
All times are GMT -4. The time now is 06:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy