+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AWK AWK stands for "Aho, Weinberger, and Kernighan". It is named after its creators Alfred Aho, Peter Weinberger, and Brian Kernighan, who developed the language while working at Bell Labs in the 1970s. replace a word with another word awk '{gsub(/sreejith/, "Balakrishnan"); print}' filename // This will replace all the sreejith to Balakrishnan Print a particular word if that appears in the file awk '{for(i=1;i<=NF;i++) if ($i == "word") print $0}' filename Print only once if a word was found in the file awk '{for (i=1; i<=NF; i++) if ($i == "sreejith" && !seen[$i]++) print $i}' test-file.txt Print the last word that has "america" as its last word awk '$NF ~ /america$/' test-file.txt or awk '$NF ~ /america$/{print $0}' test-...
Flag Description -A, --user-agent <string> Specifies the User-Agent string to send to the server. -b, --cookie <data> Sends cookies to the server. Can be a string or a file name. -c, --cookie-jar <file> Writes cookies to the specified file after the transfer. -d, --data <data> Sends data in a POST request. Can be used with application/x-www-form-urlencoded or application/json (with -H ). -F, --form <name=content> Submits form data. Useful for file uploads and multipart forms. -G, --get Forces curl to use the GET method instead of POST when -d is used. -H, --header <header> Adds a custom header to the request. Multiple h...
Special Variable Description $# Number of positional parameters (arguments) passed to the script. $? Exit status of the last executed command. A value of 0 usually indicates success, and any non-zero value indicates an error. $0 The name of the script or command that is being executed. $1 , $2 , ... The first, second, and subsequent positional parameters passed to the script. $1 is the first argument, $2 is the second, and so on. $* All the positional parameters passed to the script, treated as a single word. "$@" All the positional parameters passed to the script, treated as separate words. This preserves each parameter as a distinct word, even if they contain spaces. ...
Comments
Post a Comment