12-10-2007
Re: Very small Shell Script Help...
#!/usr/bin/ksh
if [[ $1 != "" ]]; then
ext=$1
else
echo "Not enough input arguments."
echo "Usage: basename $0 <extension_name>
exit
fi
if [[ ! -d $ext ]]; then
mkdir -p $ext
fi
mv *.$ext $ext/.
# untested... should work...
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
here is a small script:
if ; then
echo please enter an argument
fi
if [ "$1" = "tom"; then
a=$1
echo $a
fi
here is my question. if the script name is j.sh and I run it : j.sh from shell prompt: without a parameter: it prints please enter an argument but if I go with . j.sh (current... (1 Reply)
Discussion started by: rkl1
1 Replies
2. Shell Programming and Scripting
# doloadsfs.sh - load scribe data into new SFS files
for s in c e f h m
do
for f in 0001 0002 0003 0004
do
hed -n ma$s.$f.sfs
slink -isp -f 20000 c:/data/scribe/scribe/dr1/mt/ma$s/a${s}pa$f.pes \
ma$s.$f.sfs
anload... (8 Replies)
Discussion started by: abrox
8 Replies
3. Shell Programming and Scripting
Hi,
I am new to unix shell scripting. I just want a little script to check the no. of processes are equal to 8, then echo a successful message otherwise echo a unsuccessful message. Please help.
Thanks. (3 Replies)
Discussion started by: everurs789
3 Replies
4. Shell Programming and Scripting
Hi All,
this small script is written to recognize user input character.. it is in small case .. upeer case or is a number... but when i input first capital letter say A.. it always gives small character.... what is the problem.
#!/bin/bash
echo "Enter the character"
read a
case $a in
)... (2 Replies)
Discussion started by: johnray31
2 Replies
5. Shell Programming and Scripting
Hi Guys,
Please can some one explain me the below part of code. In this code what is the use of the line in Bold.
COPY=0
if ; then
echo "$CONF exists and is non-empty - backing it up"
SUFFIX=`date +%Y%m%d%H%M%S`
echo "cp -p $CONF $CONF.$SUFFIX"
cp -p $CONF... (4 Replies)
Discussion started by: max29583
4 Replies
6. Shell Programming and Scripting
Hi Buddies,
The following is shell scripts which was borrowed from linux box for load average check. it runs good.
(this structure is simple, when load average is too high, it will send alert to user)
#!/usr/bin/ksh
# Set threshold for 1, 5 and 15 minture load avarage
# configured for... (4 Replies)
Discussion started by: GreatJerry
4 Replies
7. AIX
Hello all, could somebody help..?
I have following 6 files (with white spaces in their names)
This is file
This is file1
This is file2
This is file3
This is file4
This is file5
This is file6
I tried to run the below script, and it did not give me desired ouput..
$ for i in `ls -1`
>... (7 Replies)
Discussion started by: gsabarinath
7 Replies
8. Shell Programming and Scripting
Hello Forum members,
Have a nice day.
I have to write a script for the following below scenario.
There are 3 applications located in home directory(ie xyz/app) which have multiple directories and files of diff format(.sh,log,other formats).
Case 1: I have to find the hardcoded... (8 Replies)
Discussion started by: rajkumar_g
8 Replies
9. UNIX for Dummies Questions & Answers
I have a scenario where i need to look for files of these kind
filename.log.0
filename.log.1
if the files are present, then no action is to be taken, if not found,
then it shud create/touch files with the same name.
so can anyone help constructing the script for me..appreciate ur help.
... (5 Replies)
Discussion started by: win4luv
5 Replies
LEARN ABOUT DEBIAN
dh_xul-ext
DH_XUL-EXT(1) mozilla-devscripts suite DH_XUL-EXT(1)
NAME
dh_xul-ext - calculate XUL extension dependencies
SYNOPSIS
dh_xul-ext [options]
DESCRIPTION
dh_xul-ext is a helper tool for packaging XUL extensions. It calculates the supported XUL applications for the packages that contain an
install.rdf file. It will set the substitution variables xpi:Depends, xpi:Recommends, xpi:Breaks, xpi:Enhances, and xpi:Provides. Unknown
options will be ignored.
OPTIONS
-h, --help
Display a brief help message.
-a, --all
Expand substvars to all known XUL applications. If this parameter is not provided, substvars will only be expanded to the XUL appli-
cations that are available on your distribution. Use this parameter if you want to create a package that can be installed on all
Debian-based systems without recompiling.
-p package, --package=package
Calcalate the substvars only for the specified package. If this parameter is not provided, all package listed in the control file
will be processed.
-v, --verbose
Print more information.
ENVIRONMENT
DH_XUL_EXT_VENDOR
The vendor (for example, Debian or Ubuntu) that should be used for calculating the dependencies. dpkg-vendor(1) will be used for
determining the vendor if this environment variable is not set. Setting the variable to all will have the same effect than calling
dh_xul-ext with --all.
AUTHOR
Benjamin Drung <bdrung@debian.org>
dh_xul-ext October 2011 DH_XUL-EXT(1)