Sponsored Content
Full Discussion: $(< file ) and $( cat file )
Top Forums Shell Programming and Scripting $(< file ) and $( cat file ) Post 303012378 by Scrutinizer on Saturday 3rd of February 2018 01:12:05 AM
Old 02-03-2018
It does not work that way. $(<file) is a special case, which is a faster alternative to $(cat file). If you are using anything other than just a file, it becomes something else. $( ... ) is just command sustitution, so if we leave out that, it becomes:
Code:
< /dev/urandom tr -dc '[:alnum:],@#:!?+-' | head -c10

This is the same as tr -dc '[:alnum:],@#:!?+-' < /dev/urandom | head -c10
Code:
cat /dev/urandom -- tr -dc '[:alnum:],@#:!?+-' | head -c10

This is strange, it effectively just means cat /dev/urandom | head -c10
Code:
cat /dev/urandom | tr -dc '[:alnum:],@#:!?+-' | head -c10

This is the same as the first one with UUOC
Code:
< /dev/urandom | tr -dc '[:alnum:],@#:!?+-'  | head -c10

This is equivalent to :< /dev/urandom | tr -dc '[:alnum:],@#:!?+-' | head -c10, which is that same as :
: | tr -dc '[:alnum:],@#:!?+-' | head -c10
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cat and lp or pr printing of file

Can you use cat to send the first 25 lines of a file to the printer? I'm thinking I can pipe it with '|' but I'm not school to check printer output. With the 'nl' used, all lines are numbered on the print out, but how does one number only the blank lines? Thanks:) (1 Reply)
Discussion started by: bitwize
1 Replies

2. Shell Programming and Scripting

cat file problem

Hi, I wnat to read a fiel line by line and store each line in a variabel, so I made a for loop: for i in `cat file` ; do #do sth. done; The problem is, that in the file, there are lines with only asterisks like this... (3 Replies)
Discussion started by: bensky
3 Replies

3. UNIX for Dummies Questions & Answers

Easiest way to cat out first 100 lines of a file into a different file?

Not sure how to do this exactly.. just want to take the first 100 lines of a file and cat it out into a second file. I know I can do a more on a file and > it into a different file, but how can I make it so only the first 100 lines get moved over? (1 Reply)
Discussion started by: LordJezo
1 Replies

4. UNIX for Dummies Questions & Answers

How to cat file

I want to cat a file with only show the line contain '/bin/bash' but don't show the line contain 'load' (don't show if the line contain 'load' and '/bin/bash' together), how to type in the command? thk a lot! (2 Replies)
Discussion started by: zp523444
2 Replies

5. Shell Programming and Scripting

Cat all yesterdays file into one file?

I am looking for a command to take files with a specific date and cat them all into big file. I know I can use commands to list all of the files from a certain date. But I want to do that and take those files and make on large files containing all of them. Any help would be great. This is being... (1 Reply)
Discussion started by: Jcheetwood
1 Replies

6. Shell Programming and Scripting

split a line of a file and cat a file with another

Hi, I have two files one.txt laptop boy apple two.txt unix linux OS openS I want to split one.txt into one line each and concatenate it with the two.txt output files onea.txt laptop (4 Replies)
Discussion started by: avatar_007
4 Replies

7. Shell Programming and Scripting

Cat file

how to cat a file by ignoring first line and last line (1 Reply)
Discussion started by: thelakbe
1 Replies

8. UNIX for Advanced & Expert Users

cat can not open file

Hi All, I have stumbled upon very unique issue. In my script I am doing cat file and then greping and cutting so as to assign the value to variable. My file is, <mxc_tl_load_extractdata_prop.bsh> DB_USER=test_oper hostname=xxx FTP_USER=test1_operate MAIL_LIST=xxx@yyy.com... (1 Reply)
Discussion started by: paragd
1 Replies

9. UNIX for Advanced & Expert Users

for i in `cat file` do

in bash: for i in `cat file` ; do echo $i done; how will i do this in perl ? (10 Replies)
Discussion started by: linuxgeek
10 Replies

10. Shell Programming and Scripting

Ssh cat file output into a file on local computer

Hello, I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer? I cannot use scp, because it's blocked. something like: ssh root@remote_maschine "cat /file" > /locale_machine/file :rolleyes: (2 Replies)
Discussion started by: borsti007
2 Replies
XScreenSaver(1) 					      General Commands Manual						   XScreenSaver(1)

NAME
xjack - all work and no play makes jack a dull boy SYNOPSIS
xjack [-display host:display.screen] [-foreground color] [-background color] [-window] [-root] [-delay usecs] DESCRIPTION
All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. ENVIRONMENT
DISPLAY All work and no play makes jack a dull boy. XENVIRONMENT All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. SEE ALSO
X(1), xscreensaver(1) COPYRIGHT
Copyright (C) 1997 by Jamie Zawinski. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a dull boy. All work and no play makes jack a fnord dull boy. All work and no play makes jack a dull boy. AUTHOR
Jamie Zawinski <jwz@jwz.org>, 15-Nov-97. X Version 11 18-sep-97 XScreenSaver(1)
All times are GMT -4. The time now is 01:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy