Sending variable to ASP server fromOSX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sending variable to ASP server fromOSX
# 1  
Old 11-21-2003
Sending variable to ASP server fromOSX

I've gotten this far with this script to run at log-in

computer= netstat -I en0 | grep .dh | awk '{ print $4 }' | sed 's/\.[^/]*$//'
open http://testweb.bsu.edu/aglabreserve/login_name.asp?computer=$computer
echo $computer

Problem is: The echo tells me what I want to hear. The ASP isn't getting it.
If I try to hard code it with out put from echo with

computer='wayne-1.dhcp.bs'
open http://testweb.bsu.edu/aglabreserve/login_name.asp?computer=$computer
echo $computer

then the ASP gets it.

Is the (computer= netstat...) line of code doing something to my variable?
-chris
# 2  
Old 11-21-2003
If this is really what you are running (ie you copied/pasted), I think you just have a syntax error. You need to encase the command in `.

You are just executing the command and setting computer to NULL. Your echo is probably just echoing a blank line - try echoing it twice. It works for me as (or as close as my variant of unix will let it):

computer=`netstat -I en0 | grep .dh | awk '{ print $4 }' | sed 's/\.[^/]*$//'`
open http://testweb.bsu.edu/aglabreserve/....asp?computer=$computer
echo $computer

Cheers,

Keith
# 3  
Old 11-21-2003
In the original the echo does actually give me the name.
just won't feed it up to the ASP page

when I try adding the ''s

computer=`netstat -I en0 | grep .dh | awk '{ print $4 }' | sed 's/\.[^/]*$//'`

I get an error message
./loggin17.sh: netstat -I en0 | grep .dh | awk {: command not found
# 4  
Old 11-21-2003
try putting a \ before the '

besides in
computer= netstat ....

is there a space after that =

actually i have note really understood what the asp part etc is for, but my suggestions are as for the syntaxes only. hope it helps
# 5  
Old 11-25-2003
Kevin and LinuxPenguin, You were right the first time.
I just figured out the difference between single quotes and the back tick.
It's working now.
thanks.
-chris
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

ASP.NET 5 Application on Centos OS7 Web Hosting Server

Hi All, Frankly I'm new to Linux Environment. While we are trying to Host an ASP.NET 5 Web Application on Centos OS7 Web hosting Server. There were couple of steps which we are supposed to go through, please see this link - We are stuck at Create a Container & then Running the Container,... (1 Reply)
Discussion started by: John Fredric
1 Replies

2. UNIX for Advanced & Expert Users

Sending email from UNIX server

Hi, I am trying to send an output of a script in an email. I want to know if there is a way to modify the senders email not as my username on the host server but as one of the sender preset on outlook. I was using cat email.log | /bin/mailx -c cclist -r myemailid -s "subject" tolistids ... (4 Replies)
Discussion started by: gopajitmalakar
4 Replies

3. Shell Programming and Scripting

Sending sqlplus output to a shell variable

I am trying to import a sqlplus output into a shell variable but it doesnt seem to be working. set -x export DEPENDENT_CR_NO=`sqlplus -s /nolog <<EOF conn username/passwd set heading off select dependency from custom_patches where patch_name='PATCH.zip'; exit; EOF` echo $DEPENDENT_CR_NO ... (2 Replies)
Discussion started by: beginer314
2 Replies

4. Shell Programming and Scripting

Sending Sed/Echo output to Variable

I have a variable $WORDS that contains a string Then i want to use sed to break it up. echo $WORDS | sed 's// /g' I tried setting this as a variable by doing WORDS2=`echo $WORDS | sed 's// /g'` But when i do this it does not return me to the prompt properly ie. jmpprd-v1> jmpprd-v1>... (4 Replies)
Discussion started by: nitrobass24
4 Replies

5. Shell Programming and Scripting

Perl: Sending file from UNIX server to Windows server

I'm trying to write a Perl script where a file from a UNIX server box connects to a Windows server box and copies that file into the Window box. The main problem I have right now is that whenever I try to connect to the Windows box, the connection is refused. The error message that always pops... (2 Replies)
Discussion started by: kooshi
2 Replies

6. Shell Programming and Scripting

sending variable value via mailx

Hi all, I need to send a variable value in the script through mailx. Please find the script below but its not working. agents.sh: agents=`grep "Tot Agents " snapshot.dbm` if (( $? == 0 )); then mailx abc@gmail.com $agents fi (3 Replies)
Discussion started by: db2cap
3 Replies

7. Solaris

Sending a file to a server

Dear Experts, please help i am very much confused here and not getting the right path, actually i want to send a file from client to a server, initially i used mmap() which is failing most of the time so i want to use general IO streams to do that, i can open a file in "rb" mode and read... (1 Reply)
Discussion started by: vin_pll
1 Replies

8. Programming

Sending mail in C/C++ in unix server

Hi Frnds, I have a task in my project wherein i have to send out a mail from my C++ code.With some file attachements.Please help me in this. At a higher level wat i can tell is my code generated 3 csv file and i have to send these files as attachement. My code is executed in unix... (6 Replies)
Discussion started by: electroon
6 Replies

9. UNIX for Advanced & Expert Users

sending email via mail server

hi everyone i am facing one problem. there is one unix server in our organisation which stores daily routine backup, and one mail server which is on windows 2k3, they are on one intranet. now i want that a mail should be generated and sent to the e-mail id of employees like nitin@hotmail.com... (1 Reply)
Discussion started by: parmeet
1 Replies

10. Shell Programming and Scripting

running ASP on server

I have a .asp page on my server on the internet. how do i view that page online ? e.g www.mysite.com/page.asp what do i have to do to make it work ?? (1 Reply)
Discussion started by: perleo
1 Replies
Login or Register to Ask a Question