LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-03-2007, 03:26 PM   #1
kaviazzz
LQ Newbie
 
Registered: Feb 2007
Posts: 21

Rep: Reputation: 15
echo '$1'


i trying to create a script to display on my g15 keyboard messages from amsn...

i could just use the following command on amsn

echo -e 'TO 2 2 2 1 "$name"\nTO 10 10 1 1 "$msg"\nTO 30 30 1 2 "aMSN"\nPR 1 1 160 9\n' > ~/.g15amsn

but amsn cannot execute the command echo on incoming message trigger

so i try now to create a bash script to do it

but my problem is than using echo, '' and variables doesnt work

i want to use the following command

echo -e 'TO 2 2 2 1 "$1"\nTO 10 10 1 1 "$2"\nTO 30 30 1 2 "aMSN"\nPR 1 1 160 9\n' > ~/.g15amsn

so i can just execute from amsn scriptname $name $msg

anyone knows how to use a variable inside ''

also tried to use "" instead of '' but event if it displays exactly the same in console if i dont use >~/.g15amsn, the driver wont get the expected chars.

Any clues ???
 
Old 08-03-2007, 03:29 PM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
The general rule is that variable expansion does occur within double quotes, but not single quotes. Odd that it didn't work for you.
 
Old 08-03-2007, 03:39 PM   #3
kaviazzz
LQ Newbie
 
Registered: Feb 2007
Posts: 21

Original Poster
Rep: Reputation: 15
writing in kate i noticed that the color changes to red when i insert the ' ' when i take them off the variable works but it "driver" doesnt read the sequensed different commands... try it your self
typing echo '$USER' gives $USER

the whole command after -e is inside single quotes!!!

i just noticed that i posted to the wrong category... sorry about that

Last edited by kaviazzz; 08-03-2007 at 03:51 PM.
 
Old 08-05-2007, 10:14 AM   #4
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
You need to end the single quoted strings before starting double quoted strings, and vice versa:

echo -e 'TO 2 2 2 1 '"$1"'\nTO 10 10 1 1 '"$2"'\nTO 30 30 1 2 '"aMSN"'\nPR 1 1 160 9\n' > ~/.g15amsn
 
Old 08-17-2007, 02:10 AM   #5
kaviazzz
LQ Newbie
 
Registered: Feb 2007
Posts: 21

Original Poster
Rep: Reputation: 15
i just test it fast and it worked thkz m8.... so anyone wants to view msn messages to g15 a fast way is just o add this on alarms... nothing special no wrapping !!!! bus is easy and usefull!! thkz again
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ls | echo, I got blank, why can't echo take the 2nd seat in a pipeline? elinuxqs Linux - Newbie 6 11-24-2006 08:25 AM
BASH: How to NOT echo to screen with "if echo $x | grep ".*"; then" eur0dad Programming 9 07-27-2006 02:14 PM
Kphone echo (echo echo) scabies Linux - Software 0 10-18-2004 02:59 PM
echo $? amaze Linux - General 5 08-15-2003 05:36 AM
Echo /devPrinting doesn't work, echo /usb/lp0 works, Testpage works, Printing doesn't Hegemon Linux - General 3 08-15-2002 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration