10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
PH=(6H 0 0 JD 9S 0 KD 0) #input from .txt file
In the above array, I am trying to get the computer to tell me at what indices the non-zeros are at.
I don't understand why this doesn't work...
grep -v -b "0" ph.txt > position.txt
Isn't grep -v supposed to show non matches in Bash?... (2 Replies)
Discussion started by: cogiz
2 Replies
2. Shell Programming and Scripting
Dear all,
Please help with the following.
I have a file, let's call it data.txt, that has 3 columns and approx 700,000 lines, and looks like this:
rs1234 A C
rs1236 T G
rs2345 G T
Please use code tags as required by forum rules!
I have a second file, called reference.txt,... (1 Reply)
Discussion started by: aberg
1 Replies
3. UNIX for Dummies Questions & Answers
Hi Experts,
I'm writing script to find out last files and its modified date - unfortunately am having problem with the below script.
Error message:
"grep: sales.txt: No such file or directory"
#!/bin/bash
var=1
var1=`awk '{n++} END {print n}' sales.txt`
while ]
do
prod=$var... (6 Replies)
Discussion started by: parpaa
6 Replies
4. Shell Programming and Scripting
Hi, I am currently working on a Bash shell script that
- Downloads a webpage, in this case youtube.com
- Extracts Number of views, Extracts Title of video, Extracts User who made it, and lastly Duration. Then I have to Out put this into columns.
To me this sounds like crazyness. I'm very new... (6 Replies)
Discussion started by: Njzangel
6 Replies
5. Shell Programming and Scripting
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)
Discussion started by: adrian777uk
2 Replies
6. UNIX for Dummies Questions & Answers
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
Discussion started by: jcdole
1 Replies
7. Shell Programming and Scripting
When it comes to programing and UNIX, I know just enough to be really really dangerous.
I have written a python script to parse through a file that contains ~1 million lines. Depending on whether a certain string is matched, the line is copied into a particular file. For the sake of brevity,... (4 Replies)
Discussion started by: errcricket
4 Replies
8. Shell Programming and Scripting
Hi,
I am very new to bash scripting and I need to write a bash script that takes two arguments, a string and a file. The output should be each line which matches the string *from the beginning of the line*. For example, given a string "ANA" the line starting with "ANABEL" will be printed, but... (9 Replies)
Discussion started by: jboy
9 Replies
9. Shell Programming and Scripting
I'm trying to make a simple search script but cannot get it right. The script should search for keywords inside files. Then return the file paths in a variable. (Each file path separated with \n).
#!/bin/bash
SEARCHQUERY="searchword1 searchword2 searchword3";
for WORD in $SEARCHQUERY
do
... (6 Replies)
Discussion started by: limmer
6 Replies
10. Shell Programming and Scripting
Hi guys,
I have been making a simple script for looking for anagram solutions in a word list (a file of 22k or so words).
At the moment it funtions like so:
User enters an 8 character string (whatever letters you want to find anagrams of, or solve rather)
The script moves all the words... (2 Replies)
Discussion started by: Donthommo
2 Replies