Sponsored Content
Full Discussion: Those simple one liners
The Lounge What is on Your Mind? Those simple one liners Post 302791537 by ahamed101 on Monday 8th of April 2013 04:32:40 PM
Old 04-08-2013
Those simple one liners

I wanted to say LOL and punch my face when I saw post#11 (where Don_Cragun even reduced the string manipulation with a simple regex) in the thread https://www.unix.com/shell-programmin...ilename-2.html

I mean, when things can be done with just a one liner, sometimes I tend to forgot those simple things and go for unwanted iterations.

Does this happen to you? You write a 10 liner and "HE" comes in with a one liner and you will be like "what?". Can't agree if someone says it cause of experience not in this case at least. May be our brain misses something sometimes and thinks too complex?

--ahamed
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

invaluable resource for shell one liners and more

Hi all, This link might help whom is seeking a quick solutions for thier daily shell needs. linkAll commands | commandlinefu.com (1 Reply)
Discussion started by: h@foorsa.biz
1 Replies

2. Shell Programming and Scripting

awk - one liners

Guys, I have a requirement like this. A file has >5K records always. Separated by "|", it has 30 fields for each line. In some lines, I am getting an odd field. say, the 15th field is supposed to be 2 characters but comes in as >2. In this case, for resolving this I need to copy the value of... (6 Replies)
Discussion started by: PikK45
6 Replies

3. Shell Programming and Scripting

awk one liners into a nice script

Hi All, I got some awk one liners, how can i split it all into a nice script? Got these: gzcat capgw0.log-201308161376632741.gz | sed -n '/2013-08-16 05:56:/,/2013-08-16 05:58:/p' > timebased.log awk -F":|," 'FNR==NR && /INFO - AId:/ {a=$0;next} END {for (i in a) print i "|" a}'... (8 Replies)
Discussion started by: batka
8 Replies

4. What is on Your Mind?

One liners, quick rant...

Hi fellas and fella-esses... There are numerous threads on here where people ask for, and often expect, solutions to difficult problems solved using _one_liners_. Why do they insist as such when it is virtually no different in execution time with well thought out indented code? Is it me... (12 Replies)
Discussion started by: wisecracker
12 Replies
simple_lock(9r) 														   simple_lock(9r)

NAME
simple_lock - General: Asserts a simple lock SYNOPSIS
#include <kern/lock.h> void simple_lock( simple_lock_t slock_ptr ); ARGUMENTS
Specifies a pointer to a simple lock structure. You can declare this simple lock structure by using the decl_simple_lock_data routine. DESCRIPTION
The simple_lock routine asserts a lock with exclusive access for the resource associated with the specified slock structure pointer. This means that no other kernel thread can gain access to the locked resource until you call simple_unlock to release it. Because simple locks are spin locks, simple_lock does not return until the lock has been obtained. NOTES
You must call simple_lock_init (once only) prior to calling simple_lock to initialize the simple lock structure for the resource. A resource, from the kernel module's standpoint, is data that more than one kernel thread can manipulate. You can store the resource in global variables and in data structure members. RETURN VALUES
None FILES
SEE ALSO
Routines: decl_simple_lock_data(9r), simple_lock_init(9r), simple_lock_terminate(9r), simple_lock_try(9r), simple_unlock(9r) Data Structures: slock(9s) simple_lock(9r)
All times are GMT -4. The time now is 11:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy