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
ADVERTISEMENT
Aug 21, 2009
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
View 6 Replies
View Related
Jul 28, 2011
i am trying to declare an environmental variable in the /etc/profile' (as per the tutorial i'm following) but when i declare it and do an echo i get nothing.Here's what i've done so far..nside /etc/profile:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then
[code]...
View 12 Replies
View Related
Dec 14, 2010
How can I make radiolist dialog which content so many options what is the value of the variable?Quote:
echo "How many options?"
read=VAR
dialog --title "sdf" --backtitle "sdff" --radiolist "ffdsfsd" 15 60 5 "1" "first" on "2" "second" off "3" "third" off "4" "fourth" off etc..
I must explode dialog in loop and add options? or something like that?
View 2 Replies
View Related
Apr 25, 2011
go about developing this add-on. i am testing this on my xbmc-live set-up; i am fairly affluent in bash/ c but unfortunately i dont have experience with python.i trimmed the data using this bash 1-liner so the output looks like:
Code:
xbmc@XBMCLive:~$ wget -q --output-document=- www.google.com/movies | sed -n 3p | tr '<' "
" | egrep "(title_bar|id=link_1_theater|class=info|mid=|Rated|class=times|fandango)" | grep
[code]...
View 2 Replies
View Related
Nov 26, 2010
Code:
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
How would i write a script to display permission on each folders in $PATH variable below format.
drwxr-xr-x 2 0 root 4096 Nov 24 14:51 /usr/kerberos/sbin
drwxr-xr-x 2 0 root 4096 Nov 24 14:51 /usr/kerberos/bin
This is what i did but since it require awk programming i m stuck.
Code:
ls -ld <directoryinpath>
Code:
# echo $PATH | awk -F ":" '{ print $1 }'
/usr/kerberos/sbin
View 4 Replies
View Related
Dec 26, 2010
When i ssh to server using -X, i always confuse about which display number i should export. It seems to me sometimes the display number has been used by something, so what i can do is only
export DISPLAY=localhost:0 && xclock
export DISPLAY=localhost:1 && xclock
export DISPLAY=localhost:2 && xclock
[code]....
View 1 Replies
View Related
Nov 22, 2010
#the file temp contain a path to a directory int the first line
a= `head -1 temp`
bash: /home/ram/linuxTraining/scripting/testDir/test1Dir/test2Dir: is a directory
View 4 Replies
View Related
Apr 7, 2010
my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
foo=+12.40
bar=${foo#+}
View 4 Replies
View Related
Apr 25, 2011
how I can search within a variable and assign the results to a new variable. I'll use the following as an example -
cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`
with the echo command I get the following output assigned to list -
A
C
C
What I'd like to get for output is -
Audi
Cadillac
Chevy
how I could do this regardless of upper/lower case letters?
View 5 Replies
View Related
Jul 26, 2009
I am currently using and working on Fedora 10 and have couple of monitors set up to itNow, I want to display different content on different monitors (not the same content on all monitors). It should keep displaying Pictures and/or videos with a certain intervals of time as soon as the fedora loads. How should make this happen.
View 5 Replies
View Related
Apr 28, 2010
included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?
View 8 Replies
View Related
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
Jul 31, 2010
I recently got the problem that Thunderbird does not displays the messages anymore. The e-mails are downloaded form the server, a new email warning is given, but the e-mail cannot be displayed (in fact it is not loaded in the message window. I could only see the TB start page). I cannot even see the old messages.
However, when use "see message source" I can see the e-mails.
I also noticed this message in the error console:
server does not support RFC 5746, see CVE-2009-3555
I use Fedora 12 + thunderbird 3.0.6-1
On another linux box F9+ThB 2.0.0 I do not have that issue.
Today I upgraded to Fedora 13 + TB 3.1.1. This should be the latest one, but I still cannot see the message.
Also, on F13 I got another issue with Firefox 3.6.7. When I switch between the tabs, the tabs will turn black and will not get back to normal for 10-15 sec. It looks liek a random effect because often only part fo the page turns black. This issue appear in the windows of TB 3.1.1 since updated to F13.
My hardware is a Sony SR49 laptop with ATI mobility Radeon HD3470
Have Google chrome and this black page issue is not present. The same with Evolution mail, but I do not like it.
View 1 Replies
View Related
Jun 4, 2011
I have a fresh install OpenSuSE 11.4 installation. I have install Apache 2 ,I have change the content on the owner and group to chown wwwrun.nobody Directory /srv/www/htdocs. Now apache cannot display the content anymore there is no error in the error_log. If I change the content to my user the content is displayed. Why and how can I fix this the permission are the same as on the previous web server and I'm using index.php as the index page..
View 9 Replies
View Related
May 14, 2010
This server is for dhcp and sharing purposes.I can actually access one nfs share via other ubuntu and osx clients on the network, then I configured another share with different mount point (different drive, different forlder, different contents).The problem is: when I connect form a client to the new one it displays the same exact content of the first share. It seems that is mounting the same share on a different mount point on the client and exporting the shares via the exportfs -ra command doesn't solve nothing.This is my fstab file
Code:
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
[code]....
View 1 Replies
View Related
Mar 11, 2011
I would like to see the last received IMAP email and its content with Fetchmail. Is it possible?
View 3 Replies
View Related
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
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
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
Dec 1, 2010
What's the difference between PHP echo() and PHP print(), especially in the execution time?
View 6 Replies
View Related
Feb 17, 2011
I run opensuse 11.3/KDE:Factory. Recently, kmail updated to using akonadi. The following problem came up. My local emails are now managed by a "local folders" component of akonadi. The folder structure is displayed correctly in Kmail. However, no emails are shown for some folders. Emails still live in the .kde4/share/app/kmail directory hierarchy and can be imported into a new folder after moving them somewhere else. However, even after a fresh import sometimes emails are no longer recognized.
View 2 Replies
View Related
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
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
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
Mar 17, 2011
This loop is part of a bash script which takes multiple arguments.
Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))
[code]...
View 3 Replies
View Related
Dec 16, 2010
What is the difference between
$echo cat
$cat echo
View 1 Replies
View Related
Jun 9, 2010
I am connected to work via a VPN. I am logging into a Solaris box at work from OpenSuse 11, using ssh -X. I would like to start a GUI on the solaris box. The problem is that I don't know what value to give the DISPLAY variable. Is it the local internal LAN ip address, for my machine? I did try that, and I tested it using, xterm on the solaris machine. It says it can't open the display. I have enabled remote connections on my machine using xhost +.I have to run a performance test on the Solaris box at 7am in the morning... so need to find out how to start the GUI
View 6 Replies
View Related
Sep 26, 2010
Is there a conky variable that displays the Ubuntu version (ex 10.04)?
View 9 Replies
View Related
Dec 25, 2009
my java version is this
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02, mixed mode)
And when i am trying to run my gameserver scripts i get this error.
root:~# /home/l2jserver/login # ./L2JConfig.sh Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:431)
at java.awt.Frame.<init>(Frame.java:403)
[code]....
This is not my desktop computer but my remote server.
View 1 Replies
View Related