The user will input the word or phrase .... I want to search the user input in file (by lines) but not all then with this line search on another file ( with the specific line) and show to the user.
Example:
file1.txt
=======
a
aa
aaa
aab
aac
file2.txt (corresponding md5 hashes of every text line)
======
0cc175b9c0f1b6a831c399e269772661
4124bc0a9335c27f086f24ba207a4912
47bce5c74f589f4867dbd57e9ca9f808
e62595ee98b585153dac87ce1ab69c3c
a9ced3dad556814ed46042de696e1849
========
Lets supposed to the user enter (want to crack) this hash: a9ced3dad556814ed46042de696e1849
But Im trying to call this command (sed -n "$linenum p" file1.txt) from a pipeline in C and I doesn't works ... And I think the error is the double quotes can i run the command something different.. sed -n $linenum p file1.txt (but this way doesn't work)
version info : Fedora 28 (Kernel version: 4.16.12-300)
shell : bash
Using echo command , if I redirect a text like "Chocolate" to a file , all the contents in the file are overwritten as shown below.
# cat /tmp/someTest
Hello world
One more Hello world
myLine3
# echo... (4 Replies)
Is there an environment issue that would not allow the following not store and pass the value into this field:
underScorePresent=`echo $USER | grep "_" | wc -l`
It is running on a new redhat 6.5 OS. The value $USER is set to cpac. It is a vendor code and they are saying it is environment... (1 Reply)
My current line command is as follows:
echo -n "text: " ; grep "blah text" ../dir1/filename | wc -l
The output to the screen is as needed, but how do I print to a text file? (9 Replies)
Is there any way in a script to print out the commands being ran? In DOS script, there is the "@echo on" and "@echo off".
so I have a script like this:
#!/bin/ksh
echo "hello there. moving files."
<turn on echoing here>
cp thisfile.txt thatfile.txt
cp whatfile.prop whyfile.prop
<turn... (2 Replies)
Hello,
well what I'm trying to do is to remove underscores from filenames and leaving empty spaces instead:
arturas@Universe:/windows/Center/training$ ls
big_file failas su shudu
arturas@Universe:/windows/Center/training$ a=big_file
arturas@Universe:/windows/Center/training$ mv $a `echo... (8 Replies)
Hi,
I am cutting data from a fixed length test file and then writing out a new record using the echo command, the problem I have is how to stop multiple spaces from being written to the output file as a single space.
Example:
cat filea | while read line
do
field1=`echo $line | cut -c1-2`
... (6 Replies)
I am performing a grep command and I need to know how to echo "NONE" or "0" to my file if grep does not find what i am looking for.
echo What i found >> My_File
grep "SOMETHING" >> My_File
I am sure this is easy, I am sort of new at this!
Thanks (2 Replies)
Hi, i've got the following:
a=`echo $b | grep '^.*/'`
i'm storing in the variable the value of the variable b only if it has a / somewhere.
It works, but i don't want to print the value. How do i give the value of b to the grep command without the echo?
thanks! (5 Replies)