Re: Bash vs Perl
Uri Guttman <[email protected]> Fri, 14 Jul 2023 12:47:12 -0400
| Newsgroups | gmane.comp.lang.perl.beginners |
|---|---|
| Organization | Which Clone Am I? |
| Message-ID | <[email protected]> |
On 7/14/23 12:05, William Torrez Corea wrote: > Can I mix bash with perl in a program? > > I want to create a program in Perl to execute the bash command. do you mean to run bash inside perl? you can fork off bash scripts with backticks. > > *Basic Bash commands (echo, read, etc.)* echo makes no sense in perl as that is a piped command. perl is not a shell and doesn't directly do piping between processes > > * cd : Change the directory to a different location. > chdir is in perl > > * ls : List the contents of the current directory. > opendir and readdir > > * mkdir : Create a new directory. > perl has mkdir > > * touch : Create a new file. > touch also updates the modified time. you can create a file in perl with open > > * rm : Remove a file or directory. > unlink > > * cp : Copy a file or directory. > several modules do file copy > > * mv : Move or rename a file or directory. > rename > The program must update the package manager > that isn't clear what you mean. uri -- https://uriguttman.blogspot.com/ A Long Strange Trip A blog about computers, food, my life and silliness.