08-02-2013
This is because the perl one liner doesn't expand the shell variables $year1,$month1....$sec2 within the single quotes and consider them as undefined and therefore invalid date.
Also the second perl statement will not work since it will not be executed on the same context as the previous one and $Dh, $Dm will be undefined on this line.
You should be writing a perl script than shell script for this.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell.
So scenario is that
- I need to have one shell script which is ran as a part of crontab
- in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies
2. Shell Programming and Scripting
Hi have one Perl file inside that i am defining
at an array file.
@temp_vmdk_files = `grep vmdk '$guest_vmx'`
where my $guest_vmx=/vmfs/volumes/47e40fec-9c8bb7f7-d076-001422159f8a/BES Exchange/BES-Exchange.vmx
and i am just want to do grep of "vmdk" files from the above path
but when... (5 Replies)
Discussion started by: bp_vardhaman
5 Replies
3. Shell Programming and Scripting
Hi all,
I have the following snippet of code..
#!/bin/sh
echo "run perl script............"
#Run the verification script
perl bill_ver
echo " perl script completed....."
echo "rename files......"
#Remove from all file in the directories test, test1, test2, test3
for f in... (3 Replies)
Discussion started by: chriss_58
3 Replies
4. Shell Programming and Scripting
Hi there,
I am new to Perl and KSH. The system I am using picks up the KSH scripts and uses them in a batch job control system.
I am trying to set a variable from a perl command
#!/bin/ksh -eaxp
#*******************************************************************************
# Testing... (5 Replies)
Discussion started by: SaadLive
5 Replies
5. Shell Programming and Scripting
How to write a shell script inside a perl script code? It is possible or not. Actually i have a perl script code and i need some values from the shell script code and vice-versa i.e. some values of shell script use by the perl scipt and some values of perl script use by the shell script. So how can... (1 Reply)
Discussion started by: anupdas
1 Replies
6. Shell Programming and Scripting
Hi all,
I basically have an if statement that says if you have more than 5 changes you need to have the force flag set to 1 to proceed. like this
if ((($Changes > 5) && ($force == 1)) || (($nChanges > 0) && ($Changes < 6))) {
I now need to allow the force flag to be either 1 or 2 to... (2 Replies)
Discussion started by: rethink
2 Replies
7. Shell Programming and Scripting
Hi UNIX Pros!
Newbie here, I would like to ask if it is possible to use perl commands inside a shell script? i created a simple script which connects to oracle and run queries which the script saves to a separate .txt file for each query issued. What i want to do is to create a presentable and... (7 Replies)
Discussion started by: 4dirk1
7 Replies
8. Shell Programming and Scripting
HEllo!!
I need a script in perl that see inside a file(file.txt) that has only one row.
The row contains only this text:
logs_yearly = 20120628113345
I want that the script does this:
"Search in the file, if the date 20120628 is actual date"
Thank you!!
---------- Post... (4 Replies)
Discussion started by: super_sun
4 Replies
9. Shell Programming and Scripting
$string="test.binary.value";
$toggle="test.binary.value=true";
host=test.server.com
my $returnCode = system ( "ssh $host 'cp -p /tmp/testfile /tmp/testfile.bkup; sed -i 's/\$string.*/\$toggle/g' /tmp/testfile'" );
cat testfile
test.binary.value=false
Scenario: I am trying to... (3 Replies)
Discussion started by: Tuxidow
3 Replies
10. Shell Programming and Scripting
I am working on converting shell to Perl script. In shell we have built in function
trap
Do you know alternative in Perl or actually we don't need it?
Thanks for contribution (3 Replies)
Discussion started by: digioleg54
3 Replies