[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 71 KB, 640x480, 1274765994247.jpg [View same] [iqdb] [saucenao] [google]
2954825 No.2954825 [Reply] [Original]

pearl -p -i -e "s/$ARGV[1]/$ARGV[2]/g" `grep -i -l $ARGV[1] $ARGV[0]`

gives me error need help

/g/ has no idea

zero is directory, one is old term, 2 is what you're going to replace it with

>> No.2954851

ask /g/

>> No.2954855

>>2954825
use awk/sed

>> No.2954872

>>2954855
trying to do this in one line in perl

>> No.2954873

>>2954855
Don't embarrass yourself by supposing that any of the pathetic homeworkfags in /sci/ use linux.

>> No.2954880

>>2954873
this isn't homeowrk I'm trying to learn how to use perl and starting with some basics and challenging myself but i can't figure this out

>> No.2954897

also you have been more helpful then /g/ so far

I'm so proud

>> No.2954899

>>2954880
can't help you further cuz i don't know perl.
try /g/
or give more details.
>it gives teh erorz
doesn't fucking help lol

>> No.2954901

>>2954880
Learning perl is challenging. Pointless, but challenging. Why don't you try the Structure and Interpretation of Computer Programs instead?

>> No.2954913

>>2954901
kinda this.
as much as i don't like python i feel like it's a better scripting language to learn if you're set on learning one.

>> No.2954918

OP, unless you're doing it for school or work, I don't see any reason why you need to learn PERL.

>> No.2954920

>pearl

>> No.2954919

Can't do inplace edit: test is not a regular file.
Can't do inplace edit: test is not a regular file.
Can't open FUCK: No such file or directory.

test is a directory with 8 files 5 contain the words test i wanna replace them with fuck

>> No.2954925

>>2954918
I wanna get into networking and get some certs also taking networking courses next semester

>> No.2954930

>>2954920
was hoping no one would point that out

>> No.2954940

>>2954919
$10 says your switches are wrong.
it thinks you're trying to edit a directory and that FUCK is a file, not a string.

you're fucking up pretty bad.
RTFM again
$man perl
and
$info perl
doitfaggot

>> No.2954970 [DELETED] 

>>2954940
ummm what's this $man perl and $info perl?

>> No.2954983

>>2954940
ummm $man perl and $info perl

what do you want me to do with it?

>> No.2955040
File: 104 KB, 467x427, not sure.jpg [View same] [iqdb] [saucenao] [google]
2955040