BASH: How do I grep on a variable? (or simmilar question that makes sense)
Hi, I've been running code which very frequently calls books.csv. e.g:
Except, I'm trying to move away from using temporary files or frequently calling books.csv to improve efficiency. So I tried something like
Needless to say, it explodes (giving me about 40 lines of: "grep [data here] no such file or directory"), that's before I even try and save my grep output as a variable. Don't suppose anyone knows what path I need to be taking? Thanks in advance
I created two computers with identical hardware, and run the benchmark programs in both starting at the same exact time.
What makes no sense is that the computer that has the lower average index (121) finished the race a good 30 minutes ahead of the computer wich showed the higher avg index... (0 Replies)
I have 3 files in directory mydir named as follows, I run the sequence of commands shown below and I have questions at the result.
File names are:
ABC_GP0
ABC_GP0.ctl
ABC_GPX
Commands and results:
$ ls /mydir/ | grep *
<-- (q1) I get nothing - OK
$ ls /mydir/ | grep... (5 Replies)
Hey,
So I've run into a problem, due to my limited knowledge of Bash scripting.
Basically I've got a long script and I want to understand it before I even try and edit it. As long as I don't understand the script, I will not bother editing it.
Anyway, the following variable confuses me... (5 Replies)
Hi,
I have a loop running until a variable L that is read previously in the full script. I'd like to grep some information in an input file at a line that contains the value of the loop parameter $i.
I've tried to use grep, but the problem is nothing is written in the FILE files. It seems grep... (5 Replies)
Hi,
I've been stuck for several days on this. Using grep on a command line, I can use quotes, eg...
grep 'pattern of several words' filename
I want to do this in my bash script. In my script I have captured the several command line arguments (eg arg1 arg2) into a variable:
variable=$@
I... (2 Replies)
Okay so I'm making a simple text based game that branches into different scenarios. By branching I mean branching off into whole different files with that part of the game in it. I got tired of working on scenario 1 so I'm working on scenario 2. As I get started and try to test it, I get an error... (1 Reply)
Okay so I'm making a simple text based game that branches into different scenarios. By branching I mean branching off into whole different files with that part of the game in it. I got tired of working on scenario 1 so I'm working on scenario 2. As I get started and try to test it, I get an... (3 Replies)
Suppose I have a file named Stuff in the same directory as my script. Does the following assign the file Stuff to a variable?
Var="Stuff"
Why doesn't this just assign the string Stuff? Or rather how would I assign the string Stuff to a variable in this situation?
Also, what exactly is... (3 Replies)