Sponsored Content
Full Discussion: Execution problem with perl
Top Forums Shell Programming and Scripting Execution problem with perl Post 302402745 by ahmad.diab on Wednesday 10th of March 2010 02:19:57 PM
Old 03-10-2010
Quote:
Originally Posted by alister
In your original version, the shell is closing and reopening the single-quoted string. Try:
Code:
perl -wle '
@a=`who| perl -wlane '\''print \$F[0];'\'' | sort -u` ;
chomp @a ;
print @a;
'

Whenever you need to embed single-quotes in a single-quoted string, you need to first close the single-quoted string, add a backslash-escaped single-quote, then reopen the single quoted string immediately afterwards (all of this is to appease the shell's parser, it has nothing to do with perl).

So
Code:
'

becomes
Code:
'\''

for every instance of a single quote you'd like to place inside a single-quoted string.

Regards,
Alister

Sorry Alister but the problem as in radoulov solution
 

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 10.5 perl and cron job execution problem

Hi, I want to run a crontab job on solaris 10.5. I have configured the crontab accordingly 10 * * * * /scripts/dbalter.pl >> /scripts/cronout.txt However this does not work .Then I go to /var/mail/root and find an error in the output: From root@myserver Wed Feb 4 17:02:00 2009... (1 Reply)
Discussion started by: sonu2die4
1 Replies

2. Shell Programming and Scripting

Shell Command execution through PERL

Hi Guys, I wish to execute some shell commands through PERL. Here is what I desire to do 1) I wish to find list of directories in current working location 2) Then go in each directory and execute few commands like a) rm -rf *.log (Shell command) b) coreBuilder -f cb_tests.tcl (Some... (6 Replies)
Discussion started by: hardik_snps
6 Replies

3. Shell Programming and Scripting

Give input to a perl script while execution

Hi, I have a perl script which prints me the epoch value of a specific date and time given.Now I want to proceed to a next step ie i want to give the input at the time of execution. I have to initialise the date and time values in the script before executing it.But now i want to give the date... (3 Replies)
Discussion started by: jyothi_wipro
3 Replies

4. Shell Programming and Scripting

Perl execution debugger

If this is the wrong forum, move it. It seemed like the best. Does anyone know of a perl thing that does the same thing as bash -x except for perl? I know I can output the information I want at the right times by actually putting that in the code, but it's harder... (2 Replies)
Discussion started by: killer54291
2 Replies

5. Shell Programming and Scripting

Perl during execution???

Hi All, What happens when a Pelr script is executed.??(Jus like in C/C++ we have several stages like preprocessing,assembling,complining ,linkin',loadin'...) So similiarly In Perl we have something like compile pahse and run phase. but what exactly happens during its exec and what all... (3 Replies)
Discussion started by: Ranji Raj
3 Replies

6. Programming

"execution problem with perl"

hi everyone, before stating my problem , i just want to say thanks in advance for the time and trouble taken:-) i am an newbie to perl programming, the problem is a text file needed to be parsed, i have looked over regular expressions and string matching but coudnt helped out.. the... (4 Replies)
Discussion started by: raghuraipur
4 Replies

7. Programming

Perl script remote execution as another user

Hi gurus, I have a requirement where I need to remotely run a perl script as another user. Running the script locally as the required user is fine, however I need to su with the script due to filesystem permission issues. I do not want to update permissions on the remote server due to security... (5 Replies)
Discussion started by: melias
5 Replies

8. Shell Programming and Scripting

Execution problem unix commands in Perl CGI

I am trying to run SSH , mkdir and other unix commands using Perl CGI. But i am not able to Execute these commands. Please help me out !!!! SSH and mkdir is necessity for me. I will be thankful to you...!!!!! I am trying like: In perl CGI file i am writing like: @list = `ssh... (28 Replies)
Discussion started by: Navrattan Bansa
28 Replies

9. Shell Programming and Scripting

Execution problem

hi all, when i tried executing the script by giving following command $ sh test.sh <parameter> it shows the following output: <none> status code=0 Previously it was working fine.But now its showing this output. (1 Reply)
Discussion started by: sanjay mn
1 Replies

10. Shell Programming and Scripting

Perl execution commands

I don't know to debug the program todaylive.pl program. plz someone let me know what are the commands I need to know to debug the perl programs to find out the error on it. (3 Replies)
Discussion started by: ramkumar15
3 Replies
Gtk2::ToolShell(3pm)					User Contributed Perl Documentation				      Gtk2::ToolShell(3pm)

NAME
Gtk2::ToolShell - wrapper for GtkToolShell HIERARCHY
Glib::Interface +----Gtk2::ToolShell METHODS
ellipsizemode = $shell->get_ellipsize_mode Since: gtk+ 2.20 iconsize = $shell->get_icon_size orientation = $shell->get_orientation $shell->rebuild_menu reliefstyle = $shell->get_relief_style toolbarstyle = $shell->get_style double = $shell->get_text_alignment Since: gtk+ 2.20 orientation = $shell->get_text_orientation Since: gtk+ 2.20 sizegroup or undef = $shell->get_text_size_group Since: gtk+ 2.20 ENUMS AND FLAGS
enum Gtk2::IconSize o 'invalid' / 'GTK_ICON_SIZE_INVALID' o 'menu' / 'GTK_ICON_SIZE_MENU' o 'small-toolbar' / 'GTK_ICON_SIZE_SMALL_TOOLBAR' o 'large-toolbar' / 'GTK_ICON_SIZE_LARGE_TOOLBAR' o 'button' / 'GTK_ICON_SIZE_BUTTON' o 'dnd' / 'GTK_ICON_SIZE_DND' o 'dialog' / 'GTK_ICON_SIZE_DIALOG' enum Gtk2::Orientation o 'horizontal' / 'GTK_ORIENTATION_HORIZONTAL' o 'vertical' / 'GTK_ORIENTATION_VERTICAL' enum Gtk2::ReliefStyle o 'normal' / 'GTK_RELIEF_NORMAL' o 'half' / 'GTK_RELIEF_HALF' o 'none' / 'GTK_RELIEF_NONE' enum Gtk2::ToolbarStyle o 'icons' / 'GTK_TOOLBAR_ICONS' o 'text' / 'GTK_TOOLBAR_TEXT' o 'both' / 'GTK_TOOLBAR_BOTH' o 'both-horiz' / 'GTK_TOOLBAR_BOTH_HORIZ' enum Pango::EllipsizeMode o 'none' / 'PANGO_ELLIPSIZE_NONE' o 'start' / 'PANGO_ELLIPSIZE_START' o 'middle' / 'PANGO_ELLIPSIZE_MIDDLE' o 'end' / 'PANGO_ELLIPSIZE_END' SEE ALSO
Gtk2, Glib::Interface COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::ToolShell(3pm)
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy