07-02-2011
Thanks for the response.
Thanks very much for your response.
Can you please clear my question below?
I tried the below perl one-line commands but I could not get feel the result as expected.
echo "One 1\nTwo 2\nThree 3" | perl -ne 'print if m/^Two (\d+)$/m'
echo "One 1\nTwo 2\nThree 3" | perl -ne 'print if /(?m)^Two (\d+)$/'
But I got a result as expected when I executed the .pl file the same. Please find the file below.
#!/usr/bin/perl
$inputstring="One 1\nTwo 2\nThree 3";
if ( $inputstring =~ /^Two (\d+)$/m )
{
print "Matching\n";
}
Can you please tell why the perl one-line command has not given the output?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
why "vi" acts differently is single user mode?
Does anyone help ?
I am using "x" to delete and it keeps messing up.
Please help
Thanks (2 Replies)
Discussion started by: guest100
2 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
Well back at work and back to crashing systems again :-)
Does anyone know where I can find some decent information on single user mode? I need to be able to fix a few things. Don't know if it's possible in single user mode but I need to fix the "etc/vfstab" mainly I re-wrote it to... (2 Replies)
Discussion started by: merlin
2 Replies
3. UNIX for Advanced & Expert Users
Is there another way of switching to single user mode except by typing
/usr/sbin/shutdown 0 ???
:rolleyes: (5 Replies)
Discussion started by: kekanap
5 Replies
4. AIX
Hi All,
I have AIX 5.1 & I forgot the root password. I find out the solution is to boot in single-mode and remove the root password from the /etc/passwd file. My question is how to boot in single-mode? Also is there any password required when booting in this mode? (9 Replies)
Discussion started by: aldowsary
9 Replies
5. UNIX for Dummies Questions & Answers
How to enter single user mode when UNIX/LINUX system is starting? (1 Reply)
Discussion started by: gkreddy
1 Replies
6. SuSE
Hi All,
I used to have my suse linux(VM) server in graphic mode but not anymore since morning. I cant rolback since i loose somuch work. Any idea how to it back to normal. Thanks (6 Replies)
Discussion started by: s_linux
6 Replies
7. Solaris
:confused:
when i tried to look the status of DNS-client, it is in maintenance mode.....
Please tell me how to bring it back to online mode...PLEASE TELL ME STEP BY STEP.... PLEASE...
:wall: (2 Replies)
Discussion started by: vamshigvk475
2 Replies
8. Solaris
Hi all
I am new on sun OS. I have have little experience on linux.
The Story start from this point:
I want to put some script on start-up the terminal, but I cant do that. my shell was sh and I tried so much to find way to do that. at last someone said to me change your shell to bash. I ask how... (4 Replies)
Discussion started by: Rahim_T
4 Replies
9. Solaris
Dear All
I am trying to install my os as :
ok>boot cdrom - install
but receiving the following :
"IDprom checksum error
getexecname() failed
/sbin/rcS /etc/vfstab cannot create
INIT:failed write utmpx enrty
INIT:single user mode
INIT:execle of /etc/sulogin failed
Enter run level"
Can you... (6 Replies)
Discussion started by: hadimotamedi
6 Replies
10. HP-UX
is there a way for my C++ application to find out which mode the hpux OS is running in?
standard mode or trusted mode. (3 Replies)
Discussion started by: einsteinBrain
3 Replies