Computing.Net > Forums > Unix > variables from file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

variables from file

Reply to Message Icon

Name: Chris
Date: April 14, 2003 at 07:39:58 Pacific
OS: Unix
CPU/Ram: Sun 64
Comment:

does anyone know how to assign a variable with a value from a file?

set a = file does not work!

what should I use instead?




Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: April 14, 2003 at 13:13:11 Pacific
Reply:

#!/bin/sh
a=`cat file | head -1`

Looks like you are using csh for shell scripting. You may wish to reconsider that.


0

Response Number 2
Name: Jerry Lemieux
Date: April 16, 2003 at 17:05:24 Pacific
Reply:

Put all your variables in a file and then source it. This will set all your variables in your current shell.

. ./SHELL_NAME


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


vsftpd crash mail from crontab



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: variables from file

variables from one file to another www.computing.net/answers/unix/variables-from-one-file-to-another/7378.html

Process line from file -Cshell scr www.computing.net/answers/unix/process-line-from-file-cshell-scr/5072.html

dir path to a variable from file www.computing.net/answers/unix/dir-path-to-a-variable-from-file/7700.html