Hi,
I have Redhat 5.3 running on my machine. But when I am login through putty it gives me below error.
Without running any grep command I get this error on login and the grep command doesn't work.
login as: root
root@IP's password:
Last login: Mon Feb 16 15:27:55 2015 from IP
-bash: /bin/egrep: cannot execute binary file
-bash: /bin/egrep: cannot execute binary file
-bash: /bin/egrep: cannot execute binary file
-bash: /bin/grep: cannot execute binary file
-bash: /bin/grep: cannot execute binary file
[root@bkpdrill ~]# grep MemTotal /proc/meminfo
-bash: /bin/grep: cannot execute binary file
hello everyone,
I created a script file (info.sh) in linux centos 6.
location of file is '/etc/init.d/info.sh'
content of file is:
#!/bin/sh
#To get the MAC address
ifconfig | grep HWaddr
#To get the HDD serial no.
hdparm -I /dev/sd? | grep 'Serial\ Number'
#To get the HDD size
hdparm -I /dev/sda |grep "device size"
gave the permission by: chmod 777 /etc/init.d/info.sh
but when i run this file by: /etc/init.d/info.sh
it gives an error like...
-bash: /etc/init.d/info: cannot execute binary file
what should i do?? Actually i have to run this file during boot up..
thanks in advance..
I'm running a bash script on a Raspberry Pi to control LED pixels. I'm stuck on a basic copy command.
I have a variable called nexttemp which contains the string B_254_TieDyeKaleidoscope.fseq
That file, in the same directory, is a large binary file that I'm trying to copy to a file called MasterFseq.fseq
If I do a
cp nexttemp MasterFseq.fseq
then MasterFseq.fseq contains the B_254_TieDyeKaleidoscope.fseq file name.
I want instead to have copied the binary file to MasterFseq.fseq.
It's my understanding that a $nexttemp will point to the binary file and not the name of it but when I do a
cp $nexttemp MasterFseq.fseq
the $nexttemp is thrown away and I'm told there is no destination file name, eg.
root@FPP:/home/pi/media/sequences# echo cp $nexttemp MasterFseq.fseq
+ echo cp MasterFseq.fseq
cp MasterFseq.fseq
How do I get the binaray file, which is named in nexttemp, copied to MasterFseq.fseq?
John
Hi All,
Using grep command with a defined string, you will get the row. Can I get the column instead of row? For example,
the file content is as below:
AA BB
123 456
789 ABE
execute 'grep ABE file' will give you "789 ABE". Is there any way to get the column:
BB
456
ABE
?
Thank you very much.
Hey guys,
Something is puzzling me!
I saw someone use the grep in the following way and I'm not sure I understand what it does, and if there's any benefit to using it this way.
Code:
grep X.X.X.X /var/log/log.log | grep -v query
I checked the man file which confirmed that -v is relating to matching non grouping lines (which I'm not sure I fully understand either!) but I don't see any difference in the output of the above command versus the same command without the | grep -v query bit..
Why would you pipe grep into grep unless you were searching for something specific within the search results?
Does query mean something else?
I have installed vsftp to the server , the status is running now , but when use the command "ftp localhost" , it pops the "421 Service not available." , would advise what is wrong ? thanks
bash-3.2# /etc/rc.d/init.d/vsftpd status
vsftpd (pid 580) is running...
bash-3.2# ps -ef |grep vsftpd
root 580 1 0 15:44 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root 607 467 0 15:45 pts/0 00:00:00 grep vsftpd
bash-3.2# ftp localhost
Connected to localhost (127.0.0.1).
421 Service not available.
I want to And search grep shell
but It's hard to grep variable
---------------------------------------------------------------
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Ussage: phone searchfor [...searchfor]"
echo "(You didn't tell me what you want to search for )"
else
pass=0
find=""
for idx in $*
do
if [ -n "$idx" ]
then
if [ $pass -eq 0 ]
then
find=$(egrep "$idx" mydata)
pass=1
else
find=$("$find" | grep "$idx")
echo $find
fi
fi
done
if [ -z "$find" ]
then
echo "There is no such thing"
else
echo $find | awk -f display.awk
fi
fi
-----------------------------------------------------
there is one error : command not found
in find=$("$find" | grep "$idx")
how can I grep variable and store it into variable?
hello everyone
I'm new with Linux,,I tried to install java by using the instructions in the link below
https://www.youtube.com/watch?v=ohmZu3U9DYk
the only problem appeared in the last step "java -version" is:
neaam@neaam-desktop:~$ java -version
bash: /usr/bin/java: cannot execute binary file
can anyone help me?
Hi all,
So ever since I installed livestreamer yesterday, oftentimes when I execute a command in bash it seems to be executing livestreamer and treating everything I actually entered as arguments. For example, I will type
sudo emerge -cav livestreamer
and I will get an error messaging advising me not to run livestreamer as root.
This seems to happen 100% of the time when the command I intend to issue refers to livestreamer in any way, and only some of the times when it doesn't.
I'm pretty new to linux, and I've been able to google my way out of a few problems so far, but this one has me baffled. I've checked my bashrc file for things out of the ordinary, but to no avail. Any and all help would be really appreciated. If I've left anything out let me know.
I made the mistake of adding an xterm invocation to my ".bashrc" file. My intent was to simply execute an xterm upon initial login to the KDE environment on Debian Wheezy (though the distro probably would have made no difference). What happened is that with each invocation of "xterm", the new xterm would again invoke an "xterm" via the ".bashrc" file. Duh, infinite recursion of xterms upon login. Is there a simple way to invoke an xterm at login that doesn't itself lookup the ".bashrc" file? By the time someone answers this, I will probably find and answer somewhere in the bash/xterm man pages, but thought I'd throw it out there. Really felt stupid after having realized my mistake. Had to login to recovery command line mode and replace the ".bashrc" file with "/etc/skel/.bashrc". Cheerio
Trying to work with gnuplot in Ubuntu 12.04 I run into confusing comments about binary vs. ASCII files. Take this as an example for instance. Looking for a good explanation I open this link. It is an outstanding sample of confusion and obfuscation. My own understanding is that binary is an executable file and ASCII is a source file. With gnuplot it is all upside down. I am confused.
Thanks,- A.