Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
phacus916yI'm not an expert on sed...but it its a one liner. But you can accomplish the same with awk.
Check this thread https://stackoverflow.com/questions... -
AurthurM1176y@phacus i agree with you.. btw i think that one liner ans works on normal terminal then why its asking me to write a shell program? ( according to question)
-
Oneliner is any script that can fit in one line. So it's basically.. Any script :)
to make it more correct, the script parts should not be ; separated, i.e. every command linked to another via the pipeline.
Your sed solution is perfect for the job imo. It has the least overhead compared to other possible solutions.
Related Rants
-
gururaju56*Now that's what I call a Hacker* MOTHER OF ALL AUTOMATIONS This seems a long post. but you will definitely ...
-
linuxxx70This guy at my last internship. A windows fanboy to the fucking max! He was saying how he'd never use anythi...
-
creedasaurus62Another dev on my team just got a new machine. Before he came in today I made two separate USB installers and ...
Guys, i have a question : write a shell program to select 5 to 10 lines of a file and copy them to another file.
i wrote an ans like this:
sed -n '5,10p' filename.txt >newfile.txt
but i dont think its an 1 line program aa it has 4 marks. so.. can you tell me the ANS OF SHELL PROGRAM OF ABOVE QUESTION? thanks in advance.
ps: i am a beginner in linux shell.
question
shell
linux
bash