calling a shell script from perl - The UNIX and Linux Forums
文章推薦指數: 80 %
I have a perl script which internally calls a shell script. My problem is that the shell script should be passed command line arguments. I call a shell script ... TheUNIXandLinuxForums ForumHome LinuxandUnixManPages SearchForums SearchCommunityPosts Today'sPosts QuickLinks ManPages RedHatCommands OpenSolarisCommands LinuxCommands SunOSCommands FreeBSDCommands AllUNIX ManPages All LinuxManPages FullManRepository LoginorRegistertoAskaQuestionandJoinOurCommunity SearchForums ShowThreads. ShowPosts TagSearch AdvancedSearch QuickLinks ContactUs ForumRules Today'sPosts FAQ Pictures&Albums AllAlbums Miscellaneous WhatisMyIP Whois MarkForumsRead ShellProgrammingandScripting callingashellscriptfromperl Tags shellscripts LogintoDiscussorReplytothisDiscussioninOurCommunity ThreadTools SearchthisThread TopForums ShellProgrammingandScripting callingashellscriptfromperl # 1 10-05-2006 gurukottur RegisteredUser 42, 0 JoinDate:Apr2006 LastActivity:16March2010,10:43PMEDT Posts:42 ThanksGiven:0 Thanked0Timesin0Posts callingashellscriptfromperl Hiall, Notsureifthisistherightforumtopostqueryregardingperlscript. Ihaveaperlscriptwhichinternallycallsashellscript.Myproblemisthattheshellscriptshouldbepassedcommandlinearguments. Icallashellscriptfromperlusing: system("sript.sh"); HowdoIpasscommandlineargumentstotheshellscript? Pleaseadvise. regards, Guru gurukottur ViewPublicProfileforgurukottur Findallpostsbygurukottur # 2 10-05-2006 nathan RegisteredUser 168, 0 JoinDate:Jul2006 LastActivity:15February2012,11:03AMEST Posts:168 ThanksGiven:0 Thanked0Timesin0Posts Code: system("sript.shARG1ARG2...ARGN-1ARGN"); Itshouldbejustlikeashellcommand. nathan ViewPublicProfilefornathan Findallpostsbynathan # 3 10-05-2006 cbkihong RegisteredUser 1,622, 11 JoinDate:Sep2002 LastActivity:4May2014,6:22AMEDT Location:HongKong,China Posts:1,622 ThanksGiven:0 Thanked11Timesin10Posts Or,forinstance, Code: system("ls","-l"); cbkihong ViewPublicProfileforcbkihong Findallpostsbycbkihong # 4 10-05-2006 mahendramahendr RegisteredUser 222, 1 JoinDate:Dec2005 LastActivity:22August2008,8:28AMEDT Location:London Posts:222 ThanksGiven:0 Thanked1Timein1Post qx(echo"Hai"); mahendramahendr ViewPublicProfileformahendramahendr Findallpostsbymahendramahendr LoginorRegistertoAskaQuestion PreviousThread | NextThread 10MoreDiscussionsYouMightFindInteresting 1.ShellProgrammingandScripting Callingperlfromshellscript Iamcallingaperlscriptfromshellscript. $catmah_appln_bkp_oln.ksh #!/bin/ksh ./udb/home/udbappln/.profile ./udb/home/udbappln/sqllib/db2profile Com=/udb/udbappln/utility/systemscripts/currentUMR perl$Com/backup.pl-ddbname--tsm--purgetsmcopies21--purgetsmlogs exit0 ...(1Reply) Discussionstartedby:ilugopal 1Replies 2.ShellProgrammingandScripting callingashellscriptpresentonanotherserverusingperlscript. Hi, IamworkingonaseverA. IwanttowriteaperlscripttoexecuteashellscriptpersentontheserverB. pleasehelpmeinthis. thanksinadvance.(3Replies) Discussionstartedby:anandgodse 3Replies 3.UNIXforAdvanced&ExpertUsers CallingPERLfromaKornshellscript IamcurrentlyinAfghanistananddonothaveaccesstosomeoftheresourcesInormallydobackintheUS.Justaccessedthissiteanditlookspromising!Hopefullyyouwillnotfindmyquestiontoomuchofawasteofyourtime. IwritemostlyKornShellandPERLonSolarissystemsforthe...(2Replies) Discussionstartedby:mseanowen 2Replies 4.ShellProgrammingandScripting Howwecanpasstheargumentwhencallingshellscriptfromperlscript CansomeoneletmeknowhowcouldIachievethis InoneofperscriptIamcallingtheshellscriptbutIneedtosoonethingthatisoneshellscriptcallIneedtopasspneargument.InbelowcodeIamcallingmyftpscriptbuthereIwanttopassoneargumentsohowcouldIdothis(e.g:...(5Replies) Discussionstartedby:anuragpgtgerman 5Replies 5.ShellProgrammingandScripting Howtoacceptargumentsinshellscriptwhencallinginperl Ihaveashellscriptlikethis: #!/bin/sh $PYTHONMetarDecoder.py<.. andi my it discussionstartedby:civilsurfer callingperlsubroutinefromshellscript hi iveaperlscript eg: perlscript> #!...(4Replies) Discussionstartedby:asarunkumar 4Replies 7.ShellProgrammingandScripting Callingperlscriptinshellprogram Howtocallaperlscriptinshellprogram/shellscripting. PLSHELPME(2Replies) Discussionstartedby:hravisankar 2Replies 8.ShellProgrammingandScripting Callingashellscriptfromaperlscript Hi, IhaveoneshelscriptwhichreturnssomevalueandIamcallingthisshellscriptfromaperlscriptwhichneedstheoutput/returnvalueofshellscript. ButIdon'tknowhowtocollecttheoutput/returnvalueoftheshellscript.Cananyonegivesomeideaonit? Forexample: The...(1Reply) Discussionstartedby:siba.s.nayak 1Replies 9.ShellProgrammingandScripting CallingCGIPerlinShellscript[urgent] All Iwanttocallaperlprogramfrommyshellscript.Pleasehelpme.IwanttocallthroughURLonly.Like"http://www.test.com/CGI-bin/test?test=value" Pleasehelptowritethisscript.Thanxinadvance. Thankingyou Regards DeepakXavier(0Replies) Discussionstartedby:DeepakXavier 0Replies 10.ShellProgrammingandScripting CorrectSyntaxForCallingShellScriptinPerlModule Problem:IhaveashellscriptthatwillbecalledbyaPerlmodulethatwillconnecttoadbanddeleterows.ThePerlmodulewillbecalledbyCRON.IamusingaPerlmoduletocallashellscriptbecauseIneedtogetthedbconnectionfromPerl. HereisthePerlpseudocode: ...(4Replies) Discussionstartedby:mh53j_fe 4Replies LoginorRegistertoAskaQuestion MemberBadgesandInformationModal × Close FeaturedTechVideos
延伸文章資訊
- 1Recipe 19.6. Executing Commands Without Shell Escapes
You need to use a user's input as part of a command, but you don't want to allow the user to make...
- 2How to execute shell command in a perl script? - 博客园
https://stackoverflow.com/questions/3200801/how-can-i-call-a-shell-command-in-my-perl-script/2115...
- 3How to call a shell command in our Perl script - Educative.io
There are two ways to call a shell command from the Perl script. Syntax. We use the backticks ( `...
- 4An Easy Way to Access the OS System Command from Perl
Perl programs run on many different platforms such as Windows, Mac OS and the various UNIX ... Pe...
- 5calling a shell script from perl - The UNIX and Linux Forums
I have a perl script which internally calls a shell script. My problem is that the shell script s...