LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2016, 03:19 PM   #31
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397

I was refering to post #21 where the OP sees truncated paths from grep output
 
Old 06-23-2016, 09:39 PM   #32
susja
Member
 
Registered: May 2011
Posts: 97

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
Nah, it's the field separator I used in the awk. I was trying to effectively disable it by setting it to a new line, but apparently "-F\n" just sets it to a literal "n", so the first "n" it ran into it split the line. I just switched the gensub to use the entire input "$0" and disabled field splitting, which should take care of it.
This made the trick,
I'm all set now.
Thanks so much for your help.
 
Old 06-24-2016, 12:28 AM   #33
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,252

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
Here is another alternative for your awk:
Code:
awk -F"/" '$1 = "'$file'"' OFS="/"
 
  


Reply

Tags
find, grep


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Find files using grep and find Nitron Linux - Newbie 11 10-04-2015 12:59 PM
[SOLVED] grep: find files that do not have multiple different strings kmkocot Linux - Newbie 4 04-22-2015 01:55 PM
[SOLVED] how to use cp find and grep together to copy a list of files using find with grep babhijit Linux - Newbie 10 07-03-2013 01:25 PM
Find/grep/wc command to find matching files, print filename and word count dbasch Linux - Newbie 10 09-14-2009 06:55 PM
searching within files. cat grep find w3bd3vil Linux - Newbie 4 10-13-2008 04:59 AM


All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration