04-02-2009
Hi,
To add a command line arguement to a script try:
listit.sh
#!/bin/sh
if test $# -gt 0; then
target=$1;
else
echo "no output file specified using default.lst"
target=default.lst
fi
ls -l -S -r > $target
You can then run
./listit.sh myfile.lst
If you just run the script without an argument it will use the default.lst file.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to make shell script that takes a list of host names on my network as command line arguments and displays whether the hosts are up or down, using the ping command to display the status of a host and a for loop to process all the host names. Im new to shell scripting so Im not quite sure... (3 Replies)
Discussion started by: ewarmour
3 Replies
2. Shell Programming and Scripting
Just one question for bash shell script.
In bash script, you can use *.txt to call any files in current folder that ends with .txt, like
rm *.txt
will remove all txt file in current folder.
My question is can you actually remember or use the file name among *.txt, I know file=*.txt will not... (9 Replies)
Discussion started by: zx1106
9 Replies
3. Shell Programming and Scripting
Can anybody be kind to explaing me what the lines below mean ?
eval line=$line
export $line
] || echo $line (2 Replies)
Discussion started by: jville
2 Replies
4. Solaris
Hi Experts,
Need your help.
I am trying to send a command via ssh to about a hundred network devices. I intend to do this via a bash script something similar to the below:
ssh -l user testmachine.com "show version"
Obviously this will not work given the password prompt that comes... (2 Replies)
Discussion started by: marcusbrutus
2 Replies
5. Shell Programming and Scripting
Hi Folks,
I have a loop that goes through an array and the output is funky.
sample:
array=( 19.239.211.30 )
for i in "${array}"
do
echo $i
iperf -c $i -P 10 -x CSV -f b -t 50 | awk 'END{print '$i',$6}' >> $file
done
Output:
19.239.211.30
19.2390.2110.3 8746886
seems that when... (2 Replies)
Discussion started by: nitrohuffer2001
2 Replies
6. Shell Programming and Scripting
Hi All,
I need an assistance with the issue below.
I wrote big script in "bash" that automatically install an LDAP on Clients.
I'd be happy to know in order to avoid duplication of entries in files,
How i can define into the script, if the specific expressions already exist in the file, do... (7 Replies)
Discussion started by: Aviel.shani
7 Replies
7. Shell Programming and Scripting
Hello,
I want to write a bash script to delete the content after '#'. However, if '#' appears in a string with "", ignore this. For example,
input file:
test #delete
"test #not delete"
Output file:
test
"test #not delete"
Does anyone know how to write this script?
Thanks (1 Reply)
Discussion started by: jeffwang66
1 Replies
8. Shell Programming and Scripting
Hello All,
I was writing a Bash shell script that will be executed on both an AIX server (/usr/bin/ksh) and a SLES server (/bin/bash). The AIX server
has Bash installed at "/usr/bin/bash", which is in a different dir then the SLES server.
So basically I am writing the script on the SLES... (4 Replies)
Discussion started by: mrm5102
4 Replies
9. Shell Programming and Scripting
Hello Coders
Some time ago i was asking about python and bash performances, and i was told i could post the regarding code, and someone would kindly help to make it faster (if possible).
If you have noted, i'm on the way to finalize, finish, stable TUI - Text(ual) User Interface.
It is a... (6 Replies)
Discussion started by: sea
6 Replies
10. Shell Programming and Scripting
I am trying to look through one of my directories to remove certain files. I am pretty new to Unix and bash so I just need a little help in starting this. I know I would have to write two loops one to iterate the directories and one to iterate the files. How would I write the loops? (3 Replies)
Discussion started by: totoro125
3 Replies
ajdoc(1) General Commands Manual ajdoc(1)
NAME
ajdoc -- generate HTML API documentation, including crosscutting structure
SYNOPSIS
ajdoc [ -bootclasspath classpathlist ] [ -classpath classpathlist ] [-d path] [-help] [-package] [-pro-
tected] [-private] [-public] [-overview overviewFile] [ -sourcepath sourcepathlist ] [-verbose] [-version] [source-
files... | packages... | @file... | -argfile file... ] [ ajc options ]
Description
ajdoc renders HTML documentation for AspectJ constructs as well as the Java constructs that javadoc renders. In addition ajdoc displays
the crosscutting nature in the form of links. That means, for example, that you can see everything affecting a method when reading the doc-
umentation for the method.
To run ajdoc, use one of the scripts in the AspectJ bin directory. The ajdoc implementation builds on Sun's javadoc command line tool, and
you use it in the same way with many of the same options (javadoc options are not documented here; for more information on javadoc usage,
see the Javadoc homepage http://java.sun.com/j2se/javadoc/) .
As with ajc (but unlike javadoc), you pass ajdoc all your aspect source files and any files containing types affected by the aspects; it's
often easiest to just pass all the .java and .aj files in your system. Unlike ajc, ajdoc will try to find package sources using the speci-
fied sourcepath if you list packages on the command line.
To provide an argfile listing the source files, you can use use the same argfile (@filename) conventions as with ajc. For example, the
following documents all the source files listed in argfile.lst, sending the output to the docDir output directory.
ajdoc -d docDir @argfile.lst
See the ajc documentation for details on the text file format.
ajdoc honours ajc options. See the ajc documentation for details on these options.
ajdoc currently requires the tools.jar from J2SE 1.3 to be on the classpath. Normally the scripts set this up, assuming that your
JAVA_HOME variable points to an appropriate installation of Java. You may need to provide this jar when using a different version of
Java or a JRE.
Examples
Documenting Spacewar
o Change into the examples directory.
o Type mkdir doc destination directory for the documentation.
o Type ajdoc -private -d doc spacewar coordination
o (Use -private to get all members, since may of the interesting ones in spacewar are not public.)
o Type ajdoc -private -d doc @spacewar/demo.lst to use the argfile associated with Spacewar.
o To view the documentation, open the file index.html in the doc directory using a web browser.
ajdoc(1)