If no arguments are entered I wanna be able to read 2 arguments, i have done like this but it doesnt work:
x=0
until #loop starts
do
if ; then
echo No arguments were entered, please enter 2 arguments.
read $1 $2
elif || ; then
echo $#... (0 Replies)
my description from another thread...
here's my code:
#!/bin/bash
IFS=$'\n'
function OutputName() {
input=$1
echo $input
input=`echo "$input" | sed -e 's/.//'`
input=`echo "$input".avi`
output_name=$input
}
if ]; then
echo... (5 Replies)
I have to use shell script to run series of commands on another unix box by connecting through SSH and giving user credentials. For running commands on remote machine I have to use options reading from a local file.
Process:
Connecting to remote unix server <host1.ibm.com> through ssh
Login: ... (2 Replies)
Hi all,
I want to get options from command line by perl.
usage()
options:
-h Show this help message and exit
-t Name of tester
--timeout Set the timeout
-l ... (1 Reply)
Hello everyone,
I have a perl script which takes various command line options from user like :
test.pl -i <input_file> -o <output_file> -d <value> -c <value>
Now I have multiple input files in a directory:
<input_file_1>
<input_file_2>
<input_file_3>
<input_file_4>
.....
....
...... (6 Replies)
Being new to awk I have a really basic question. It just has to be in the archives but it didn't bite me when I went looking for it.
I've written an awk script, placed it in a file, added the "#!/usr/bin/awk -f" at the top of the script and away I go. "% myAwk <inputfile>" gives me exactly what... (2 Replies)
I'm reading about debugging aids in bash and have come across the set command. It says in my little book that an addition to typing
set
you can also use them "on the command line when running a script..." and it lists this in a small table:
set -o option Command Line... (5 Replies)
Hi,
Just some questions on the script below...?
Given: bash-2.03$ command -a option1 name1 name2
ParseOptions()
{
local Len=${#@}
local Ctr=2 #always start at 2
local Name=()
local Iter=0
while ; do
if <- Is this correct? so I can get the $2... (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Creating bash script the dd command and its new options (-l -U)
-l options to lowercase contents of file
-U... (2 Replies)
Hi all
I have spent half a day trying to create a shell script which reads a configuration file on a line by line basis.
The idea of the file is that each will contain server information, such as IP address and various port numbers. The line could also be blank (The file is user created). Here... (1 Reply)
Discussion started by: haggismn
1 Replies
LEARN ABOUT LINUX
alien::package::rpm
Alien::Package::Rpm(3pm) User Contributed Perl Documentation Alien::Package::Rpm(3pm)NAME
Alien::Package::Rpm - an object that represents a rpm package
DESCRIPTION
This is an object class that represents a rpm package. It is derived from Alien::Package.
FIELDS
prefixes
Relocatable rpm packages have a prefixes field.
METHODS
checkfile
Detect rpm files by their extention.
install
Install a rpm. If RPMINSTALLOPT is set in the environement, the options in it are passed to rpm on its command line.
scan
Implement the scan method to read a rpm file.
unpack
Implement the unpack method to unpack a rpm file. This is a little nasty because it has to handle relocatable rpms and has to do a bit
of permissions fixing as well.
prep
Prepare for package building by generating the spec file.
cleantree
Delete the spec file.
build
Build a rpm. If RPMBUILDOPT is set in the environement, the options in it are passed to rpm on its command line.
An optional parameter, if passed, can be used to specify the program to use to build the rpm. It defaults to rpmbuild.
version
Set/get version.
When retreiving the version, remove any dashes in it.
postinst
postrm
preinst
prerm
Set/get script fields.
When retrieving a value, we have to do some truely sick mangling. Since debian/slackware scripts can be anything -- perl programs or
binary files -- and rpm is limited to only shell scripts, we need to encode the files and add a scrap of shell script to make it
unextract and run on the fly.
When setting a value, we do some mangling too. Rpm maintainer scripts are typically shell scripts, but often lack the leading shebang
line. This can confuse dpkg, so add the shebang if it looks like there is no shebang magic already in place.
Additionally, it's not uncommon for rpm maintainer scripts to contain bashisms, which can be triggered when they are ran on systems
where /bin/sh is not bash. To work around this, the shebang line of the scripts is changed to use bash.
Also, if the rpm is relocatable, the script could refer to RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by
adding code to the script to set RPM_INSTALL_PREFIX.
arch
Set/get arch field. When the arch field is set, some sanitizing is done first to convert it to the debian format used internally. When
it's retreived it's converted back to rpm form from the internal form.
AUTHOR
Joey Hess <joey@kitenet.net>
perl v5.12.3 2011-06-11 Alien::Package::Rpm(3pm)