LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-01-2020, 06:29 AM   #1
BudiKusasi
Member
 
Registered: Apr 2017
Distribution: Artix
Posts: 345

Rep: Reputation: 15
To save into variable the certain find result


How do we save into variable the certain find result, in e.g,
________________________________|
Code:
find ~+ \( -maxdepth 1 -type d  -exec find '{}' -size 9 print \) -o type f printf "%p\n" -o
...
________________________________ ^__

the pointer tells to the point in which only a variable should get the value / string which is only one since in one (the current) dir. only one unique name of any type is allowed, and ignore the other of many find results

Any useful help is gratified

Last edited by BudiKusasi; 12-01-2020 at 06:32 AM.
 
Old 12-01-2020, 08:16 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
Code:
var="$(find ...)"
 
  


Reply


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
BASH: Trying to extract a field from a variable, and place the result in a new variable fribse Linux - Newbie 10 03-05-2019 04:29 AM
replace space with newline and save result in a variable sktimmy Linux - General 5 11-01-2011 11:56 AM
Assigning query result into a variable/file swathikumar Linux - Newbie 4 05-26-2011 02:33 AM
How do you pass an expect command result into a variable and then use it again? edomingox Programming 2 05-09-2010 01:51 AM
cannot export result from awk into a variable in a bash script Emmanuel_uk Linux - Newbie 4 03-07-2005 01:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:56 PM.

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
Open Source Consulting | Domain Registration