Scripting

Perl and Shell Scritping Windows

Posted on

Code to list all Windows environment variables in current user shell C:>perl -e “foreach (sort keys %ENV) {print “$_ = $ENV{$_}n”; } “; > Tempperl-env.txt C:> Single Command to combine all files in directory into single file. C:Temptest>dir /w *.json | grep -i json tasklist-level-1.json   tasklist-level-2.json   tasklist-level-3.json tasklist-level-4.jsonC:Temptest>copy *.json combined-file.json tasklist-level-1.json tasklist-level-2.json tasklist-level-3.json tasklist-level-4.json 1 file(s) copied. C:Temptest>dir /w *.json | grep -i json combined-file.json      tasklist-level-1.json   tasklist-level-2.json tasklist-level-3.json   tasklist-level-4.json C:Temptest>wc -l C:Temptest>wc -l combined-file.json 2230 combined-file.json C:Temptest> Single command line to find and replace string in all files of a folder.  Use Cygwin on Windows. gunnalag@GMD /cygdrive/c/temp $ grep -r […]

Advertisements
Scripting

Windows Perl Scripting Info

Posted on

Best and latest Perl books are avail on O’Reilly’s CD Bookshelf online C:>perl -v This is perl, v5.8.6 built for MSWin32-x86-multi-thread <= This indicates it’s a 32bit distribution. (with 3 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall Binary build 811 provided by ActiveState Corp. http://www.ActiveState.com ActiveState is a division of Sophos. Built Dec 13 2004 09:52:01 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found […]