Using commands within the command 'set'


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using commands within the command 'set'
# 1  
Old 07-15-2011
Using commands within the command 'set'

Hi Everyone,
I'm relatively new to using c shell and I'm trying to understand a script for data processing. In it they use the set command:

E.g. one such line:
set scan = 'cat /home/wera/etc/.scan'

When I try to test the command myself with my own files:
set scan = 'cat /home/mweather/Test'
and then use:
echo $scan
it produces:
cat /home/mweather/Test

What I was hoping it would do is display the contents of the file Hello:
Hello, this is a test

Is it because I'm using tcsh and the script I am trying to understand is using csh?

Any advice on why the cat command doesn't work within the set command would be appreciated, thank you!

---------- Post updated at 01:51 PM ---------- Previous update was at 01:43 PM ----------

Ok so I just figured it out - I will leave this post up just in case anyone wants the answer - I was using the apostrophe ' instead of ` . That simple!
# 2  
Old 07-15-2011
try
Code:
set scan = `cat /home/wera/etc/.scan`

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how do i execute a set of commands in telnet??

I have list of commands in a file in one sever and i need to execute these set of commands in the server to which i m telnetting to .. (4 Replies)
Discussion started by: nikhil jain
4 Replies

2. UNIX for Dummies Questions & Answers

how to set top arrow to get the history of last used commands

guys can any one help me how to set top arrow to get the history of last used commands.I am using ksh (3 Replies)
Discussion started by: etldev
3 Replies

3. Solaris

export vs env vs set commands

Hi I'm trying to understand variable scopes in solaris10. It is said that to display env variables we use 3 commands : - env - set - export What is the difference between them ? thx for help. ---------- Post updated at 11:00 AM ---------- Previous update was at 10:50 AM ---------- ... (2 Replies)
Discussion started by: presul
2 Replies

4. Shell Programming and Scripting

ssh - to execute set of commands

Hi Can someone help me to figure out Want to execute few cmds in remote host thru ssh Tried below cmd -------------------------------excerpt------------------- RDIR=/data1/logs ---> variable stores rem. server directory TODAY="`date '+%b %d'`" ssh -i $userid@$host "cd... (2 Replies)
Discussion started by: id100
2 Replies

5. AIX

How to set dhcp client by using commands

Hi, I have used "smit tcpip" to setup dhcp client but it does not work. Don't know why. Now I want to try using commands to do the job. I have studied commands chdev and mktcpip but did not find howto. Please help. Thank you! (1 Reply)
Discussion started by: aixlover
1 Replies

6. Shell Programming and Scripting

using nohup with set of commands

hi I want to use nohup command with set of commands .. my goofy sample : nohup while true do ; date; done and its not working . any idea ? cheers (1 Reply)
Discussion started by: kvok
1 Replies

7. Shell Programming and Scripting

How to run a set of commands through ssh

I need to run a set of commands on a remote machine using ssh. it should also collect output and return status of each command. Can someone help me how to do this? (1 Reply)
Discussion started by: vickylife
1 Replies

8. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (6 Replies)
Discussion started by: ran16
6 Replies

9. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (0 Replies)
Discussion started by: ran16
0 Replies

10. Shell Programming and Scripting

Running a queued set of commands?

Is there a way I can queue something like 800 commands in a BASH (or anything else for that matter) script? I just basically don't want to have 800 commands pound my system at once. So far I have been just running the list (dynamically generated) through a loop, and executing every command in... (1 Reply)
Discussion started by: jjinno
1 Replies
Login or Register to Ask a Question

Featured Tech Videos