Converting shell to Perl I run into shell built in function trap and need alternative in Perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Converting shell to Perl I run into shell built in function trap and need alternative in Perl
# 1  
Old 03-22-2017
Converting shell to Perl I run into shell built in function trap and need alternative in Perl

I am working on converting shell to Perl script. In shell we have built in function
Code:
 trap

Do you know alternative in Perl or actually we don't need it?

Thanks for contribution
# 2  
Old 03-22-2017
I'd start here
This User Gave Thanks to vgersh99 For This Post:
# 3  
Old 03-22-2017
I did, but I don't know why shell is using trap. It is clean directories and exit
# 4  
Old 03-22-2017
Quote:
Originally Posted by digioleg54
I did, but I don't know why shell is using trap. It is clean directories and exit
... or to do whatever 'cleanup' needs to be done (based on the script functionality)
This User Gave Thanks to vgersh99 For This Post:
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

Perl program to run a Shell script issues...

Hi all, I have the following Perl script which is intended to run a Shell script and generate some logging for the purposes of tracking weather or not the script ran. I get an error, of course, since I don't know what I'm doing really. Here is the code: #!/opt/perl/bin/perl -w ... (14 Replies)
Discussion started by: zixzix01
14 Replies

3. Shell Programming and Scripting

HELP on Perl array / sorting - trying to convert Korn Shell Script to Perl

Hi all, Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM. Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers. At the moment am... (3 Replies)
Discussion started by: newbie_01
3 Replies

4. Homework & Coursework Questions

Shell script calling Perl function, sort and find data, write to new files

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I must write a shell script that calls two external Perl functions--one of which sorts the data in a file, and... (6 Replies)
Discussion started by: kowit010
6 Replies

5. Shell Programming and Scripting

Perl - pass shell-vars into perl for input loop

I need to process a file line-by-line using some value from a shell variable Something like:perl -p -e 's/$shell_srch/$shell_replace/g' input.txt I can't make the '-s' work in the '-p' or '-n' input loop (or couldn't find a syntaxis.) I have searched and found... (4 Replies)
Discussion started by: alex_5161
4 Replies

6. Shell Programming and Scripting

Converting Perl code to shell

I have a perl code that runs like Code I sub p { if ($d >= $D) {return} printf "%3s"x$d++," "; printf "%s%s\n",$_,$h{$_}?" ** ":""; if (!$h{$_}) { $h{$_}=1; map {p($_)} @{$s{$_}} } $d-- } ($Set,$Job,$Num,$D) = (@ARGV); map {shift} 0..3; (8 Replies)
Discussion started by: zainravi
8 Replies

7. Shell Programming and Scripting

How to run perl code within a shell script...?

Hi, I have a sheel script that invokes a perl script...Now, instead havin the perl script as a separate file I'd like put the contents in the sheel script itself...But I am not sure how ro run that perl script contents.please help me Thanks (1 Reply)
Discussion started by: vijay_0209
1 Replies

8. UNIX for Dummies Questions & Answers

Converting bash shell to perl

Does anyone know how to convert this bash shell script to perl? for i in `ls -l *pgp` do `usr/bin/gpg --passphrase-fd 0 $i < .sunspot` done Thanks! Any help would be appreciated. I'm new to Linux and perl. (4 Replies)
Discussion started by: freak
4 Replies

9. Shell Programming and Scripting

Run shell program in perl

Hello , I want to run some shell scripts in my perl script. I need to read the script's name from a file ( this file includes the name of all the scripts) and run the script one by one.. Please let me know how to go .. Thanks in advance, Radha (5 Replies)
Discussion started by: s123.radha
5 Replies

10. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies
Login or Register to Ask a Question