Read perlrun for more information. Some examples follow.
(These assume standard Unix shell quoting rules.)
# sum first and last fields
perl -lane 'print $F[0] + $F[-1]' *
# identify text files
perl -le 'for(@ARGV) {print if -f && -T _}' *
# remove (most) comments from C program
perl -0777 -pe 's{/\*.*?\*/}{}gs' foo.c
# make file a month younger than today, defeating reaper daemons
perl -e '$X=24*60*60; utime(time(),time() + 30 * $X,@ARGV)' *
# find first unused uid
perl -le '$i++ while getpwuid($i); print $i'
# display reasonable manpath
echo $PATH | perl -nl -072 -e '
s![^/+]*$!man!&&-d&&!$s{$_}++&&push@m,$_;END{print"@m"}'
Unix news is nothing but Opensourse - this site features general information about Linux - Unix - Python and Perl programming language. Lately i am adding more posts about Data and Data analytics in general.
Subscribe to:
Post Comments (Atom)
How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMs
This project is about how to systematically persuade LLMs to jailbreak them. The well-known ...
-
Traditionally, Unix/Linux/POSIX filenames can be almost any sequence of bytes, and their meaning is unassigned. The only real rules are that...
-
Schwachstellen-Scanning: Bedeutung und Prozess Schwachstellen-Scanning ist ein kritischer Schritt in der Informationssicherheit, der dazu d...
No comments:
Post a Comment