Programming :: Echo Hello Command Does Not Return

Jan 11, 2010

I am testing the serial ports on a Single Board Computer(SBC) running Linux kernel 2.6.29. I usually do this by connecting the serial port to another PC serial port, then doing "cat /dev/ttyS0" on PC and "echo hello > /dev/ttyS0" on the SBC. However in the current system, "echo hello > /dev/ttyS0" command does not return at all! Also no characters appear on the destination port. I am running the echo command as root. The system boot messages show that the serial port in indeed /dev/ttyS0.

View 2 Replies


ADVERTISEMENT

Programming :: What Exactly Does Echo $0 Return

Jan 18, 2010

I'm confused about what "echo $0" in a shell actually return. Consider these tests:

Code:
[root@e11apvl151 ~]# # Login shell:
[root@e11apvl151 ~]# echo $0
-bash
[root@e11apvl151 ~]# # Starting a new shell
[root@e11apvl151 ~]# bash
[root@e11apvl151 ~]# echo $0
bash
[root@e11apvl151 ~]# screen
[root@e11apvl151 ~]# echo $0
/bin/bash

Depending on wether the shell is a login shell, a regular shell, or a screen utility, I get different results.

View 8 Replies View Related

Programming :: Prevent Echo As Return Value?

Jan 25, 2010

I have always encountered this problem in ubuntu bash shell scripts that echo command in a function will be treated as a return value when used in a function. e.g.

[code]...

The output would simply be xyz. Hence the echo seems to function as a "return" command when used in a function with a return value.

View 4 Replies View Related

Programming :: Echo Two Command Output In The Same Line?

Jan 25, 2011

I try to write script and echo two command at the same line .

echo "A"
echo "B"

How can I pipe above two command at the same line in text file . So, in the output text file , you can see below ? Code: A B not Code: A B

View 4 Replies View Related

Programming :: Return Error From Ioctl Command?

Jul 21, 2010

I'm creating a usb device driver that needs to be able to read from two different endpoints. I couldn't see any way of having two read functions in the driver, so I got round this by reading from one of the endpoints with read, and the other with ioctl.However this hasn't worked, the ioctl call from c returns -1. I added a printk command in the driver in the ioctl function, however looking at kern.log I can see that this function is never being called. Does anyone have any ideas as to what the problem called be, or a better method of being able to read from two different endpoints?

View 2 Replies View Related

Programming :: Pass Carriage Return To Command Through Script

Feb 18, 2011

How can I pass carriage return to a command in the shell script. I am writing a shell script whcih generates ssh key pair. It ask for input from user three times. I want to pass carriage return (i.e., press Enter button) to this command.

View 2 Replies View Related

Programming :: Find Command Return True If File Found?

May 18, 2011

How to manage the find command to return true or false if a file was found/or not? I tried to man find but didn't found anything.

View 12 Replies View Related

Ubuntu :: Echo Command To Output First Argument

Nov 5, 2010

In a script, when I enter "echo $1" the first argument is outputted. When I enter:
a=1
echo "$$a"

The output is just "$1", not the first argument. If I enter:
a=1
b=$$a
echo $b

The output is still "$1" and not the first argument. How can I get echo to output the first argument without use "$1" directly?

View 4 Replies View Related

Software :: Echo Two Command Output In The Same Line?

Jan 24, 2011

I try to write script and echo two command at the same line .

echo "A"
echo "B"

How can I pipe above two command at the same line in text file . So, in the output text file , you can see below?

Code:
A B
not

Code:

A
B

View 9 Replies View Related

Programming :: Echo Some Value Using Awk?

Jun 17, 2009

I am trying to echo some value using awk, and for reading the file i am using cat command. If there no space in the file content then the following script result correctly.

console: # cat 1
one;two;three;
four;five;six;

[code]....

In case any space is there in the file 1 then i am facing the problem in the output value

console: # cat 1
o ne;two;three;
four;five;six;

[code]....

View 5 Replies View Related

Fedora :: Echo Exit Status After Command Is Run In Terminal?

Feb 19, 2010

command will just execute and exit with a status of "0" -"Every command returns an exit status (sometimes referred to as a return status ). A successful command returns a 0, while an unsuccessful one returns a non-zero value that usually may be interpreted as an error code. Well-behaved UNIX commands, programs, and utilities return a 0 exit code upon successful completion, though there are some exceptions."[URL]With the command . . .

Code:

# dosfsck -v /dev/sdb

it could be very helpful (and decide my next move) to see the exit code as 0, 1, or 2 . the man page suggests the command exit code will specify if the message I get - "Cluster size is zero" (I think it is a "1")is a recoverable or fixable error by the utility. or is non-recoverable - a pretty nifty feature if I understand this right. [URL] is there anything like this script COMMAND_LAST used in the following link. [URL] that can be entered in the terminal window after - or at end of - my dosfsck command or any command. just to see if it has a 0, 1, or 2 status ?

View 2 Replies View Related

General :: Enable Caps Lock By Using Echo Command?

Dec 23, 2009

How can i enable caps lock by using echo command. I know that by using syntax echo -e "33[3q" this only turns the capslock led to glow. but the capslock is not working i.e. the words are typed in small case only.

Then by using xmodmap command i.e. syntax xmodmap -e "remove lock = Caps_Lock" or xmodmap -e "add lock =Caps_Lock" doesn't work. On running this it shows unable to display.

View 1 Replies View Related

General :: Enable Capslock By Using Echo Command - Glow The Led ?

Jan 2, 2010

can anyone tell me how can one enable capslock by using echo command. ofcourse we can glow the led by using the echo command.

Its syntax is echo -e "33[3q"

On searching i found that by using $xmodmap -e "add lock=Caps_Lock" we can enable capslock. but its not working.

View 1 Replies View Related

General :: Where To Found Source Code For Echo Command?

Dec 1, 2009

Can any body tell me where can i found the source code for echo command. so that i can download it such that it can help me for further studies on echo command

View 8 Replies View Related

General :: Command Not Found For All But PWD And Echo - Path Empty

Mar 1, 2011

I logged into my Red Hat Enterprise Linux machine at work (use it for software development) and the primary GUI does not load. Instead, widgets appeared for xclock, xterm, and Firefox. In the terminal, I start typing in commands to try to figure out what's going on, but all commands are not found except pwd and echo. I 'echo $PATH' and that returns just an empty, blank line. 'echo $SHELL' lets me know I'm using cash.

The likely cause was my attempt to install Adobe Reader Firefox plugin yesterday. After it downloaded, I ran the binary but Firefox didn't seem to recognize that I had installed it, so I went into my .cshrc file and added the adobe folder to the path. That didn't seem to work, so I gave up, deleted the binary and the folder I installed to, and removed that directory from the path in the .cshrc file. This last thing (the export PATH line in that file) I'm certain is back exactly as it was before.

I have successfully added the /bin and /usr/bin back to the path from command line via
setenv PATH /usr/bin:/bin
but of course it doesn't stick after reboot nor does it magically load the primary GUI. I'd rather not go through the effort of creating a ticket for our company's Global Service Desk cuz there's no telling how long that could take to resolve. In the meantime, I can't do any programming.

View 23 Replies View Related

General :: Echo Command Error - File Exits

Mar 17, 2010

I faced a issue with updating a file contents with echo command which fails with error as below:
echo "foo" > bar //to create a file named "bar"
echo "foobar" > bar //to edit its contents

The latter fails, it prompts "File exists" i.e.
~>echo "foo" > bar
~>echo "foobar" > bar
bar: File exists.
~>cat bar
foo
~>

View 4 Replies View Related

Software :: What Is Different From Sending Call Command Within Minicom 2.5 And Echo It?

Jun 11, 2011

I have a router with linux firmware and attached to it a USB modem with which I can do both data and voice.Any other command send through echo method works ok. I was able to send SMS, edit phonebook and many many other stuff, but not make a call.So what is different from sending the call command within Minicom 2.5 and echo it?

View 1 Replies View Related

Programming :: Difference Between PHP Echo() And Print()?

Dec 1, 2010

What's the difference between PHP echo() and PHP print(), especially in the execution time?

View 6 Replies View Related

Programming :: EPOLL Echo Server Not Concurrent?

Feb 16, 2011

I am working on an epoll version of an echoserver that I am porting from a multithreaded version I wrote.What it should do: The server should get a connection from a client > say x client connected > print x message from said client. What it is doing: The server looks like it is only accepting one connection at a time, and any other clients are queued. When the queue is empty it looks like the program is aborting with a SIGABRT. EDIT:// fixed the program exiting in the close function. Still one client at a time

Code:
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>

[Code]...

View 5 Replies View Related

Programming :: Need Exploit Codes For An Echo Program In C?

Mar 13, 2011

I am a student taking part in a comptition. We have a set of questions to complete within today. Can anyone please help me out with it. I have a custom written "echo" program in C, running on port number "1220" which echoes back the first 16 characters of whatever is given as the first command line argument. But somehow, my brother had got unauthorized remote root access. The program is given below. How did he do it? Please give the exploit code and explain how it works.

#include
#include
void echo(char* input) {

[code]....

View 2 Replies View Related

Programming :: Use Echo To Display The Content Of A Variable?

Jan 4, 2010

I have a problem to use echo to display the content of a variable.

This is what I do:

Code:
#!/bin/bash
USAGE="Usage: name [OPTIONS] [DIRECTORIES]"
echo $USAGE

When I run this little script I get the following output:

Usage: name [OPTIONS] R

So I think that [DI might be some sort of escape sequence. But I do not know how to unescape it. Does anyone have a hint for me?

View 14 Replies View Related

Programming :: Termios Programming - Without Removing Carriage Return / Enter Key

Jun 30, 2010

I trying to write a UART(interfacing of serial devices) to linux machine but after I execute the following code to receive data I need to enter key (carriage return).... but I don't want to remove carriage return/enter key

[Code]....

View 13 Replies View Related

General :: $echo Cat Vs $cat Echo / Difference Between Them?

Dec 16, 2010

What is the difference between

$echo cat
$cat echo

View 1 Replies View Related

General :: Get Return Value From Command Run Within Screen?

Jan 13, 2010

I'm trying to get a return value from the command running within screen. I have tried

Code:
screen "some_command ; echo $? > retval"
but this refuses to write "retval".

[code]....

View 1 Replies View Related

General :: Command To Return Number Of Bits (32 Or 64)?

Nov 7, 2010

What is a Linux command that I can run to programmatically return either 32 or 64 to indicate whether the processor is a 32 bit or 64 bit processor?

View 4 Replies View Related

Ubuntu :: Allow Empty Return From Read Command?

Feb 19, 2010

I am writing a short script to do some backups.Here is a small section of it:

Code:
echo -n "Please enter your choice ..."
read CHOICE

[code]....

View 3 Replies View Related

General :: Return Code 1 For Useradd Command?

May 2, 2011

getting a error return code for useradd commandthe return code is 1cite or tell me the explanation of return code 1 .

View 1 Replies View Related

General :: Get A Return Code For The Command Ldapmodify?

Mar 31, 2011

I need to get a return code for the command ldapmodify.I try this and didn't workrc=ldapmodify -a -v -c -p $PORT -h $SRV -D cn=$USR,cn=Users,dc=company,dc=com -w $PWD -f $LDIFFILENAMECOUNTecho "return code " $rc what exactly the way to get the return code of that ?

View 2 Replies View Related

General :: Pass Carriage Return To A Command?

Feb 18, 2011

How can I pass carriage return to a command. I am writing a shell script whcih generates ssh key pair. It ask for input from user three times. I want to pass carriage return (ie. press Enter button) to this command. Is tehre any way

View 8 Replies View Related

General :: Tomcat - Why Does 'ls' Command Return Some Results In [squarebrackets].jar

Nov 25, 2010

Below is an example output of what I see when I run the 'ls' command on some directories in linux (this is from a tomcat/common/lib directory). However I'm not clear on why some of the filenames are appearing inside [square brackets]

-rw-r--r-- 1 root root 1038825 Aug 30 2006 [ant].jar
-rw-r--r-- 1 root root 566376 Apr 1 2008 [commons-collections].jar
-rw-r--r-- 1 root root 107392 Aug 18 2006 [commons-dbcp].jar

[code]...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved