02-28-2013
You should specify path for the ls command
toMove=`ls /etc | grep -E "partition.[0-9]+"`
Do not use back ticks ``if its possible
toMove=$(ls /etc | grep -E "partition.[0-9]+")
and as paynam write: you try to move all file matching pattern partition.[0-9]+
to one singe file with this name partition.[0-9]_org
I think you try to move files like this partition.12 to partition.12_org or this partition.45465 to partition.45465_org
Last edited by Jotne; 02-28-2013 at 08:57 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I would like to check the existence of files (doesn;t matter the number of files) in a directory.
My file is named in the following manner (always ending with " myfile "). Can anybody give me some guidance?
EG:
abc1_myfile
sdfr_myfile
sffgd_myfile
and so on ......
My... (9 Replies)
Discussion started by: Raynon
9 Replies
2. AIX
we have tranferred an ear from local server to remote server using ftp.consider, we have an ear file named a.ear in remote server,again if we transfer the same file named a.ear from local server to remote server.we need the kshell to check the existence of the ear file in remote server,and if the... (3 Replies)
Discussion started by: karthikprasathk
3 Replies
3. AIX
Hello
I am having a requirement like if there is no file in the directory then i need a message to pop on after the execution of the script.
My script basically does for File in `ls -t $DIRECTORY | tail -1`;
if there is no file the DIRECTORY then the script is simply exiting with out... (2 Replies)
Discussion started by: dsdev_123
2 Replies
4. AIX
I have requirement where i need to search for files which start with SALESORDER and PURCHASEORDER. i need to process the files with SALESORDER first and then PURCHASEORDER. If SALESORDER files are not there i dont want to process PURCHASEORDER and i want to come out of script. I have written a code... (4 Replies)
Discussion started by: dsdev_123
4 Replies
5. Shell Programming and Scripting
i want to check if the file is in the directory or not, and also it should be handle error conditions, like missing files and report the error and exit.
i did something like this:
file ="hello"
if !test -e "${file}"
then echo "No such files exist!"
exit 1
else
do something.......
fi
... (1 Reply)
Discussion started by: mingming88
1 Replies
6. Shell Programming and Scripting
I am using the following command to check for files on a Unix (Solaris 9) and on Linux:
if (-r *.) then
echo " las file found"
else
echo " no las file found"
endif
If no las file is present, the "no las file found" message is displayed. If a las file is present, however, I get... (9 Replies)
Discussion started by: phudgens
9 Replies
7. Shell Programming and Scripting
Hi All.
Pls help me with the command to check existence of files (I'll mention name of the file as regex) and proceed with my further processing if atleast one of them exists
in detail,
I've a dir /tmp/TURP, which may or may not have files named with "exter*.txt"
I need to check and... (2 Replies)
Discussion started by: skpvalvekar
2 Replies
8. UNIX for Dummies Questions & Answers
I need to check for the existence of a file *.log in a specific directory using a perl script.
Presently am not in that particular directory.
So i am using chdir ("/path/to/my/file)
And then i am using the -e in an if statement to check if it exists.
if (-e $File) {......}
$File contains the... (1 Reply)
Discussion started by: manutd
1 Replies
9. Shell Programming and Scripting
Hi,
I am looking for a shell script with the following.
1. It should check whether a particular file exists in a location
#!/bin/sh
if ;
then
echo "xxx.txt File Exists"
else
echo "File Not Found"
fi
2. If file exists, it should check for the modified date and run a command... (2 Replies)
Discussion started by: karthikeyan_mac
2 Replies
10. Shell Programming and Scripting
hi
i wanted to check if the file exist or not(multiple files)
DIRE=/home/V478
if ;
then
echo "file present"
else
echo "file not present"
fi
But i am getting the error as
: [: unexpected operator/operand (3 Replies)
Discussion started by: ATWC
3 Replies
LEARN ABOUT HPUX
vparadmin
vparadmin(1M) vparadmin(1M)
NAME
vparadmin - modifies attributes for the virtual partition flexible administrative capability
SYNOPSIS
vp_name] | |
DESCRIPTION
The command is used to add or delete a Designated-Admin vPar. It can also be used to change the virtual partition flexible administrative
password.
Options are valid when the virtual partition flexible administrative capability is enabled.
Options
recognizes the following command line options and arguments. The options are mutually exclusive.
Adds the virtual partition
to the Designated-Admin vPar list in a secure virtual partition environment. It will prompt for the existing virtual parti-
tion flexible administrative password before allowing the addition.
Deletes the virtual partition
from the Designated-Admin vPar list. It will prompt for the existing virtual partition flexible administrative password
before allowing the deletion.
Changes the virtual partition flexible administrative password.
It will prompt for the old password for validation.
Displays the Designated-Admin vPar list.
If no arguments are supplied, indicates whether the virtual partition flexible administrative capability is enabled or disabled.
SECURITY RESTRICTIONS
This command is restricted to processes owned by a superuser.
RETURN VALUE
The command exits with one of the following values:
Successful completion.
One or more error conditions occurred.
EXAMPLES
Use vparadmin without any options:
The virtual partition fle xible administrative capability is disabled.
Add the name of the virtual partition called to the Designated-Admin vPar list:
---------- Designated-Admin virtual partitions ----------
Oslo
To change the virtual partition flexible administrative password:
Old password:
New password:
Re-enter new password:
vPar flexible administrative password successfully changed.
ERRORS
displays error messages on standard error for any of the following conditions:
o An invalid option is specified.
o An invalid value is specified for an option or a value is omitted.
o does not exist in the monitor database.
o One or more options are specified more than once.
AUTHOR
was developed by the Hewlett-Packard Company.
SEE ALSO
vparboot(1M), vparcreate(1M), vparmodify(1M), vparremove(1M), vparreset(1M), vparresources(5), vparstatus(1M), vpmon(1M).
vparadmin(1M)