LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 02-22-2018, 08:58 AM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
meaning of $(<filename) in bash


In this link (https://stackoverflow.com/questions/...sing-last-line) I saw the following:
Code:
$ for line in $(<y); do echo $line; done
As far as I can tell, 'y' is the name of a file. What is the "<" supposed to mean?

thanks
 
Old 02-22-2018, 09:00 AM   #2
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Ok, I think I get it. It's simply inputting the content of the file name called "y"
 
Old 02-22-2018, 09:17 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I think that is a correct interpretation, however not one I've ever used.

In the future, would suggest you post questions about scripting or programming in the Programming forum. There's a much greater concentration of expertise in that forum versus in Newbie.
 
Old 02-22-2018, 09:19 AM   #4
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Ok, thanks for the tip. I tended to use the newbie forum because it seems to be a noobish question, but I get your point.
 
  


Reply



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] bash ${1#*@} Meaning? P.G.Krish Linux - Newbie 3 12-23-2016 05:55 AM
What are the meaning and the relevance of #!/bin/bash? ravi_nandula Linux - Newbie 9 03-29-2012 07:31 AM
bash: best way to get filename and extension using bash frenchn00b Programming 5 01-09-2010 01:47 PM
meaning of if [ -z $SOMETHING....] in bash shell darwinianlo Linux - Newbie 8 08-09-2007 11:02 AM
Meaning of .files and when to use ./filename costasm Linux - Newbie 3 10-19-2003 09:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:16 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
Open Source Consulting | Domain Registration