3 ms·
"Javascript is required for ZeroBin.net to work. Sorry for the inconvenience." Here's the contents of the paste: I stumbled upon/essentially derped the: ls
by jwilk 9y ago
"Javascript is required for ZeroBin.net to work.
Sorry for the inconvenience."
Here's the contents of the paste:
I stumbled upon/essentially derped the:
ls | grep "echo ${data}"
... line, saying oh this should work... and it actually worked.. I didn't think anymore about it...
... but later on, I thought about it more and decided echoing the variable shouldn't actually work, and you should have to do a for loop instead... and that it should fail in the same way that piping thru a cat of the file should fail (and does fail):
ls | grep `cat ../filelist.txt`
...does not work/no output (as expected)
But, piping to grep and echoing the variable actually works and returns the wanted results/matches!! How is this possible?
[jbrown@tools1 testdir1]$ ls | grep `cat ../filelist.txt`
<<NO OUTPUT>>
[jbrown@tools1 testdir1]$ ls | grep "echo ${data}"
testfile10
testfile2
testfile3
testfile4
testfile5
testfile6
testfile7
testfile8
testfile9
[jbrown@tools1 testdir1]$ echo ${data}
testfile1 testfile2 testfile3 testfile4 testfile5 testfile6 testfile7 testfile8 testfile9 testfile10
[jbrown@tools1 testdir1]$ cat ../filelist.txt
testfile1
testfile2
testfile3
testfile4
testfile5
testfile6
testfile7
testfile8
testfile9
testfile10
[jbrown@tools1 testdir1]$ ls
nomatchfile1 nomatchfile2 nomatchfile4 nomatchfile6 nomatchfile8 testfile1 testfile2 testfile4 testfile6 testfile8
nomatchfile10 nomatchfile3 nomatchfile5 nomatchfile7 nomatchfile9 testfile10 testfile3 testfile5 testfile7 testfile9