Perl and Shell Scritping Windows
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 […]
Read more