Run perl command in script[solved]


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run perl command in script[solved]
# 1  
Old 02-11-2012
Question Run perl command in script[solved]

Hi all,

When I put the Perl command in a script, I got error.

Code:
system("perl -pi -e 's@words[$k]@words[$k+1]@g' myFile");

The error is:
Unrecognized character \x8A; marked by <-- HERE after دت مد�<-- HERE near column 15 at -e line 1.

Thanks in advance.

---------- Post updated at 06:30 AM ---------- Previous update was at 03:49 AM ----------

It solved!

Code:
$line=~ s/@words[$k]/@words[$k+1]/;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

[Solved] UNIX command in PERL

I tried to use this command in PERL code. when I run this on shell , it's working fine. grep -v "^#" /oratab | awk -F: '$1 == "'$server'" {print $2}' inside PERL $ohome = `grep -v "^#" /oratab | awk -F: '$1 == "'$server'" {print $2}'` ; but, it's not returning anything back ... what... (0 Replies)
Discussion started by: talashil
0 Replies

3. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

4. Shell Programming and Scripting

Better way to run this perl command

i'm working with files that are huge in size. over 3GB. and i need to do a lot of pattern matching. I need a way to grep for what i want, using a tool that is available across most unix systems. i initially was gungho about grep, but not all capablities of grep are available on all OSes. so... (10 Replies)
Discussion started by: SkySmart
10 Replies

5. Shell Programming and Scripting

[Solved] Looking for script running before I run script again

Good afternoon! I have a script in cron that runs every ten minutes. Normally it only takes a minute or so to complete. However there are times when the amount of data it is looking at is large, and it has taken 20 minutes. So I want for it to look for the script before it starts. I was... (8 Replies)
Discussion started by: brianjb
8 Replies

6. Shell Programming and Scripting

run shell script under nohup directly [solved]

Hi, i am not able to run the loop in nohup directly. nohup 'for i in $(seq 10); do echo $i;./mscript.sh $i; done' can some one help me how to run this directly in nohup? ---------- Post updated 03-15-12 at 12:20 AM ---------- Previous update was 03-14-12 at 11:59 PM ---------- From... (0 Replies)
Discussion started by: johninweb
0 Replies

7. Shell Programming and Scripting

run command with ssh[solved]

Hi all, Is it possible to make this possible ? $ echo $SKY_HOME /var/sink/SKY $ echo $SKY_HOME /home/smily/SKY $ ssh root@xyz "echo $SKY_HOME" root@xyz 's password: ****** /home/smily/SKY wrong output I was expecting the output as /var/sink/SKY (3 Replies)
Discussion started by: linuxadmin
3 Replies

8. Shell Programming and Scripting

Run perl script, with command-line options

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)
Discussion started by: ad23
6 Replies

9. Shell Programming and Scripting

Run the command inside perl script

I have a command which will run fine in a unix command prompt. Can you tell how to interprete this command inside perl script...... The command is : perl -pe 's/(\|333\}.*)\}$/$1|1.6}/' FIA.txt This will search for the number 333 and appends 1.6 at the end of that line....... (1 Reply)
Discussion started by: vinay123
1 Replies

10. Shell Programming and Scripting

Perl: Run perl script in the current process

I have a question regarding running perl in the current process. I shall demonstrate with an example. Look at this. sh-2.05b$ pwd /tmp sh-2.05b$ cat test.sh #! /bin/sh cd /etc sh-2.05b$ ./test.sh sh-2.05b$ pwd /tmp sh-2.05b$ . ./test.sh sh-2.05b$ pwd /etc sh-2.05b$ So... (10 Replies)
Discussion started by: vino
10 Replies
Login or Register to Ask a Question
Dist::Zilla::Plugin::Run(3pm)				User Contributed Perl Documentation			     Dist::Zilla::Plugin::Run(3pm)

NAME
Dist::Zilla::Plugin::Run - Run external commands at specific phases of Dist::Zilla VERSION
version 0.013 SYNOPSIS
[Run::BeforeRelease] run = script/myapp_before1.pl %s run = script/myapp_before2.pl %n %v [Run::Release] run = script/myapp_deploy1.pl %s run = deployer.pl --dir %d --tgz %a --name %n --version %v [Run::AfterRelease] run = script/myapp_after.pl %s %v ; %p can be used as the path separator if you have contributors on a different OS run = script%pmyapp_after.pl %s %v DESCRIPTION
Run arbitrary commands at various Dist::Zilla phases. CONVERSIONS
The following conversions/format specifiers are defined for passing as arguments to the specified commands (though not all values are available at all phases). o %a the archive of the release (available to all *Release phases) o %d the directory in which the dist was built (not in "BeforeBuild") o %n the dist name o %p path separator ('/' on Unix, '\' on Win32... useful for cross-platform dist.ini files) o %v the dist version o %x full path to the current perl interpreter (like $^X but from Config) Additionally %s is retained for backward compatibility. Each occurrence is replaced by a different value (like the regular "sprintf" function). Individual plugins define their own values for the positional replacement of %s. AUTHOR
Torsten Raudssus <torsten@raudssus.de> <http://www.raudssus.de/> COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Raudssus Social Software <http://www.raudssus.de/>. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.12.4 2011-11-09 Dist::Zilla::Plugin::Run(3pm)