12-04-2001
regular expressions and command-line arguments
As a follow-up question (that seems related):
I'm running .kshrc and want to script or alias the following:
ls -alF <i>regex</i> | more
I have not found how to pass an argument inside an alias
(e.g. alias dir='ls -alF $1 | more' does NOT work).
The following script 'dir' works:
#!/bin/ksh
ls -alF $1 | more
however, if I pass it an expression like '*.eva' it will only ls the first filename with the .eva extension (not ls all of the files with the .eva extension).
_Anyone_ who's read this far already has my sincere appreciation! If you can point me to man pages to help me solve this problem I'd appreciate it even more!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I was able to pass parameters to a shell script from the command line but now, I am trying to make the shell script to get those parameters/values from a file.
Please give me ideas how to do this or if you have an example or website that shows how to do this.
I tried searches but it... (2 Replies)
Discussion started by: bryan
2 Replies
2. UNIX for Dummies Questions & Answers
Can anyone help me how to write a shell script which accepts input parameter. My requirement is as follows:
I need to run a shell script with a input parameter, and inside the script i will create a file with this input parameter name.
Please help me out to create such a shell script.
... (1 Reply)
Discussion started by: jhmr7
1 Replies
3. Shell Programming and Scripting
Dear Friends,
Please help me.
How can I pass a parameter from one Shell-script to another Shell-script.
Example:
FirstScript.sh
-------------
./SecondScript.sh 'paramater'
And
SecondScript.sh
---------------
doing something with passed parameter from FirstScript.sh
Please... (2 Replies)
Discussion started by: subodhbansal
2 Replies
4. Shell Programming and Scripting
I have a script file as below named test1.sh
sed -e 's/xxxkeys/$1/g' template1.asp > template1.txt
sed -e 's/xxxkeys/$2/g' template2.asp > template2.txt
sed -e 's/xxxkeys/$3/g' template3.asp > template3.txt
sed -e 's/xxxkeys/$4/g' template4.asp > template4.txt
I want to replace $1 with a,... (1 Reply)
Discussion started by: satgur
1 Replies
5. Shell Programming and Scripting
Hi All
I have a shell script which calls all the Teradata Utiltyes . There is a sudden change in the requirment .
What i'm asked to do is
pass on the DATE to the shell script which should take the date automatically and run the utilityes.
i.e. the date should not be passed on... (5 Replies)
Discussion started by: vinayrao
5 Replies
6. AIX
I would like to run a compress script on files in certain directories.
My compress_script.sh is just basically
compress file*
In order for me to use this I have to copy it into each directory and run it.
How can I state the directory on the command line with the compress script so it... (2 Replies)
Discussion started by: NycUnxer
2 Replies
7. Shell Programming and Scripting
How can i chnage the parameter value in shell script.
file name is icare_mmi_cls.com, inside that the parameter name is 10.100.1.2" replace the address to bep-sftp.cce.com.
can you please provide me with examples.
Thanks
Double post - check your PMs and follow the rules, thanks. (0 Replies)
Discussion started by: damodarreddys
0 Replies
8. UNIX for Dummies Questions & Answers
How can i chnage the parameter value in shell script.
file name is icare_mmi_cls.com, iside that the parameter name is 10.100.1.2" replace the address to bep-sftp.cce.com.
can you please provide me with examples.
Thanks. (3 Replies)
Discussion started by: damodarreddys
3 Replies
9. Shell Programming and Scripting
Hi
I have two shell script, the second script takes as a parameter the output variable of the first script, please how to retrieve the variable from the first script to pass as a parameter to the second script?
Script1.sh
i=0
i=$(($i + 1))
Script2.sh
echo $1
Thank you (0 Replies)
Discussion started by: chercheur111
0 Replies
10. Shell Programming and Scripting
Hi All,
I need urgent Help from all of you here.
Below is my code-
==================================================
#!/usr/bin/sh
cd $1
cat $2 | tr -ds "$" "" > parameter_file.param
export `parameter_file.param`
chmod 777 parameter_file.param
echo $1
echo $2
cd $prmDirInput... (5 Replies)
Discussion started by: Amit786
5 Replies
LEARN ABOUT DEBIAN
0alias
0ALIAS(1) 0ALIAS(1)
NAME
0alias -- create quick scripts to run 0launch
SYNOPSIS
0alias ALIAS [INTERFACE [MAIN]]
DESCRIPTION
Having to keep typing the full URI for a program each time you want to run it with 0launch is annoying. 0alias will create a little script
in your PATH to do it for you.
Note: the newer "0install add" command provides a more efficient alternative to using aliases.
EXAMPLES
A program can be invoked using 0launch:
0launch http://rox.sourceforge.net/2005/interfaces/Edit
To avoid having to keep entering the URI, create an alias:
0alias rox-edit http://rox.sourceforge.net/2005/interfaces/Edit
To run Edit now:
rox-edit
To select a different version, or check for updates:
0alias rox-edit
If an interface provides more than one program, you can specify which one to use instead of the default. e.g.
0alias svn http://example.com/subversion
0alias svnadmin http://example.com/subversion svnadmin
(this is for older programs that use MAIN; for newer programs you may need to use --command instead)
COMMAND-LINE OPTIONS
-c=COMMAND, --command=COMMAND
The generated script will execute COMMAND rather than the default ("run").
-d=DIR, --dir=DIR
Install the script into directory DIR, rather than searching for a suitable directory in $PATH.
-h, --help
Show the built-in help text.
-m, --manpage
Display the manpage for the alias script given as the single argument. The alias can be an absolute pathname, or the name of a
script in $PATH. If the argument isn't an alias script, or if multiple arguments are given, then all arguments are passed to the
system 'man' command. This allows you to alias your man command like this:
alias man='0alias --manpage'
-r, --resolve
Print the interface URI for the given alias script to stdout.
-V, --version
Display version information.
LICENSE
Copyright (C) 2012 Thomas Leonard.
You may redistribute copies of this program under the terms of the GNU Lesser General Public License.
BUGS
Please report bugs to the developer mailing list:
http://0install.net/support.html
AUTHOR
The Zero Install Injector was created by Thomas Leonard.
SEE ALSO
0install(1), 0launch(1), 0desktop(1)
The Zero Install web-site:
http://0install.net
Thomas Leonard 2012 0ALIAS(1)