Use of "@ ret =" in sh script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Use of "@ ret =" in sh script
# 1  
Old 08-22-2012
Use of "@ ret =" in sh script

I've been thrown into debugging a sh script and have run into an unfamiliar bit of code. In part the code is:
Code:
 
set ret = 1
   set roop = 0
   while( $ret == 1 )
    @ ret = `rcp chPhase.dat.default "$remoteUser@$ENGINE_HOST\:/gp/tune/chPhase.dat"$remoteUser@$ENGINE_HOST\:/gp/tune/chPhase.dat`
    if( $ret == 0 ) then
     break
    endif
    @ roop ++
    if( $roop >= 10 ) then
     break
    endif
    sleep 2
   end

After days of searching I'm unable to find an explaination for the @ logical = part.
What does "@ ret" and "@ roop ++" di?

Sorry for the noob questions, I'm not a programmer, just a fall guy.
Thanks


Moderator's Comments:
Mod Comment Please view this code tag video for how to use code tags when posting code and data.

Last edited by vbe; 08-22-2012 at 05:03 PM.. Reason: rm email tags
# 2  
Old 08-22-2012
Look at this info: What does @ mean??? | DaniWeb

What shell are you using? This will show you:
Code:
ps -p $$

This User Gave Thanks to spacebar For This Post:
# 3  
Old 08-22-2012
It looks like tcsh or csh.
Code:
@[space]variablename = 10

means define variablename as numeric and assign a number to it.
This User Gave Thanks to jim mcnamara For This Post:
# 4  
Old 08-22-2012
Thank you spacebar
Thank you jim mcnamara
Both replies imply computations or value assignments and the above code is simply wanting to copy a file from the host to a remote machine. Seems like there should (and WILL) be a better way.
I can't wrap my head around the reason the author would confuse the issue so badly.
Again, thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

5. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

8. HP-UX

script running with "ksh" dumping core but not with "sh"

Hi, I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone. And its not dumping core if we run the script using "/bin/sh" instead of "ksh" Can some body please help me how to resolve this issue. ... (9 Replies)
Discussion started by: simhe02
9 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question