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
ADVERTISEMENT
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
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
Nov 28, 2010
What does echo $$ give as output?
View 3 Replies
View Related
Jun 16, 2011
if i will sound stupid but i can't find a command that would echo output of some command. Let's say that i want to echo the third line of ls -a. I know of the tail command but this command starts from behind.
View 4 Replies
View Related
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
View Related
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
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
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
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
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
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
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
Feb 23, 2010
I'm trying to write a base script which will divide an argument by 10 and then use that argument in another program. Since my argument can be a floating point number, I used bc to accomplish this. Here's an example of a simplified version of what I have so far:
<code>NUM=$(echo "scale=25;$1/10" | bc)
#make sure the first argument was formatted correctly
if [ $? -ne 0 ]
[code]...
View 4 Replies
View Related
Jun 8, 2010
I need to write a script that will take 1 command line argument. The argument will be a username. The script will determine if the user exists on the system and will print an error if it does not. If the user does exist it will determine if the user is currently logged in, if the user is not logged in it will determine the last time the user logged in and display the file in the users home directory that was most recently modified.
View 2 Replies
View Related
Jan 31, 2011
I am trying to connect to a wireless network. I got a problem with network manager. So I try to connect manually
I found wireless network around by using "iwlist scan" command.
I want to connect to a network with ESSID "MCC(Mandalay)" and Key "mdymcctraining"
Here is my problem The output of "iwconfig" command is
Code:
What does it mean "invalid argument"? It means that my wireless pre-sharedkey is not correct? I am sure the key is valid. It is used by any others with window 7.
View 1 Replies
View Related
Aug 17, 2010
I've a problem when I try to run arpd program to support my honeyd software but when I try to execute it then it shows this error message
./arpd 10.0.0.0/8
arpd: intf_get: Invalid argument
My arpd installation based on this tutorial [URL].
View 2 Replies
View Related
Jan 5, 2011
when I am running the script below,it performs on whatever logfile u type ,i.e, ./scriptname logfilename.But how do I convert it into a function and then call it from another script.I mean how do I prompt the user to enter a logname and then capture the name in the function and when calling this function from another script how do I pass the parameter.
View 3 Replies
View Related
Oct 25, 2010
I call my script with ./script -e arg2. However, $@ only shows me arg2. Surprisingly, if I use ./script -s arg2, $@ shows me both arguments. What's going on?
View 4 Replies
View Related
Sep 17, 2009
I have a python script on one server (serv_one) and I am trying to execute it remotely from another (serv_two). The python script takes an argument with spaces. If I execute it locally:
Code:
foo@serv_one> script.py --o "arg one"
"arg one" is preserved, of course. ( argv = [ '--o', 'arg one' ] )
However, when I execute it remotely:
Code:
foo@serv_two> ssh ... foo@serv_one script.py --o "arg one"
the double quotes around "arg one" are dismissed ( argv = [ '--o', 'arg', 'one' ]. I've tried many combinations of single quotes/double quotes/backslashes, etc, to no avail. One hack solution I came up with, since I have the flexibility, was to replace all spaces in the quoted argument with a character that would be invalid in the argument (before the ssh call), and replace those with spaces in script.py. I would probably like to avoid this solution if at all possible.
View 7 Replies
View Related
Dec 16, 2010
What is the difference between
$echo cat
$cat echo
View 1 Replies
View Related
Jan 25, 2011
I want to have a choice or more preferable pass shell as command line argument when I ssh to an linux account.i.e. If John logs in to account "zzz" on server "abc", by default definition of account "zzz" n server "abc" he get csh.But Sally desires that when she logs in to account "zzz" on server "abc", she needs the login shell to be ksh,and Rick wants bash when he logs in to account "zzz" on server "abc".What is the most non-intrusive / easiest way to achieve this? Each user can set their preference on ssh command line or create a simple alias by each shell, but not sure how to do this.
View 6 Replies
View Related
Aug 29, 2010
Trying to create a small script that will read user's input, test if user entered some input and if not display some message or display a text using user's input.
The script is the following but i get an error saying "[: 6: =: argument expected"
View 12 Replies
View Related
May 24, 2010
I just setup a cron that display a message like : "hello world" for every minutes. So I put this:echo "hello world" And then I waited and stare at terminal. But seems like it doesnt shown off, did I messed up something?
View 2 Replies
View Related
Jul 3, 2009
I am using openSUSE 10.3.When I install software from tarball then to record time required I send output of date to beg.txt(when installation begins) and end.txt (when installation finishes).How can I append output of date to a file so I don't need two files?
View 4 Replies
View Related
Oct 20, 2010
I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?
View 3 Replies
View Related
Jul 2, 2011
I want to run gsettings list-schemas (which return a list of about 100 names separated by spaces)and somehow direct each name one at a time as the input to this command:gsettings list-recursivelyI've tried it with awk, and standard | piping and also as a string variable strvar=$(gsettings list-schemas) and using the $strvar as the input butam missing something in between I'm sure like for - while or proper syntax of awk etc
View 3 Replies
View Related
Nov 13, 2010
I want to use the output of a previous command as a parameter to another command. For example: to know where "nice" is stored i typed: which nice output: /usr/bin/nice now the second command i typed is: ls -l /usr/bin/nice Is there a way to have a single command like: ls -l which nice ?
View 4 Replies
View Related
Mar 9, 2011
I am trying to grep multiple numbers from file, grep does have the -f option for that.
Code: grep -f <`seq 500 520` /etc/passwd I know this could be done with
Code: for i in `seq 500 520`; do grep "$i" /etc/passwd; done But my question is fare more behind this example. It is possible to redirect one command output which will be treat as a content of file for another command ?
View 2 Replies
View Related
Sep 8, 2010
I want to scan a particular directory recursively and run a particular command with each file as input. For this I am using "find /dir/path". I dont want to write any long script containing loop on the output of "find". I want a single command which will allow me to run a command on each file of the "find" command output.
View 3 Replies
View Related