Assigne an expression to a variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Assigne an expression to a variable
# 8  
Old 10-15-2009
This was my first solution :-(

---------- Post updated at 11:28 AM ---------- Previous update was at 11:19 AM ----------

Code:
timestamp.sh: +%m%d\221: not found

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assign expression to a variable

This code strips out any . It works great echo "127001" | tr -d "" I would like to do the same thing but with shell scripting. User would enter: ./test 127001 Output should be: 127.0.0.1 I would like to assign it to a different variable. I have something like this but I get a syntax error and... (7 Replies)
Discussion started by: Loc
7 Replies

2. Shell Programming and Scripting

How to evaluate a variable name on LHS of expression?

I am trying to write a simple function to select values from a database and assign them to variables. It can have any number of arguments sent into it, and I want to assign the value retrieved to a different variable name for each argument sent in. So my code looks something like this: ... (6 Replies)
Discussion started by: DJR
6 Replies

3. Shell Programming and Scripting

Regular expression as a variable

I'm trying to use a series of regular expressions as variables but can't get it to behave properly. You can see below what I'm trying to do. Here with lowercase a-z and the same with uppercase, numbers 0-9 and again with a set of special characters, without having to type out every single... (3 Replies)
Discussion started by: 3therk1ll
3 Replies

4. Shell Programming and Scripting

Trying to execute a expression in a variable

Hi i tried to execute a below script but it is giving execution error rec=ABC,1234,55.00 Colno=2 coldel=, fd='"'$coldel'"' fprint="'"'{print$'$colno'}'"'" colsyn=`echo "echo "$rec "| awk -F"$fd $fprint` echo column syntax is $colsyn colrec=`colsyn` echo column is $colrec (5 Replies)
Discussion started by: ragu.selvaraj
5 Replies

5. Shell Programming and Scripting

assigning value of a expression to a variable

eval echo \$tts_space_name$count i m getting output of this stmnt as 'TBS_ADOX_EXTR3' but, I m not able to assign this value to a variable . i tried export j=`eval echo \$tts_space_name$count` eval j= `eval echo \$tts_space_name$count` and when i do echo $j ... i get o/p as 1 or 2... (1 Reply)
Discussion started by: Gl@)!aTor
1 Replies

6. Shell Programming and Scripting

Using a variable as a for loop expression

I'm writing a script to merge the xkcd webcomic tiles for comic 1110. So far, I have written about 100 lines, and instead of doing each quadrant of the image separately, I've decided to use functions to do this, repeating for every quadrant and using variables for each quadrant to make the function... (9 Replies)
Discussion started by: jbondhus
9 Replies

7. Shell Programming and Scripting

Variable expression and while

hi, i'm reading a file "LISTE_FILE" like : # $LOGCOM * 5 $PRCCOM * 10 and i want to use the file with "while" and having the fields splitted into new variables for treatment : while read LINE do # Ignorer les commentaires un # en premiere position if then... (3 Replies)
Discussion started by: Nicol
3 Replies

8. Shell Programming and Scripting

Awk's variable in regular expression

Anyone know how I will use awk's variable in a regular expression? This line of code of mine is working, the value PREMS should be a variable: awk '$1 ~ /PREMS/ { if(length(appldata)+2 >= length($1)) print $0; }' appldata=$APPLDATA /tmp/file.tmp The value of APPLDATA variable is PREMS. ... (2 Replies)
Discussion started by: Orbix
2 Replies

9. UNIX for Dummies Questions & Answers

Assigning evaluated expression to a variable

Hello, Could you please let me know what is the problem here.. 28:var1="SERVER_$j" 29:eval $var1=`grep "^DBSERVER=" "$i" |cut -d"=" -f2` i get this error: syntax error at line 29 : `|' unexpected Thanks for your quick response..This is urgent..pls.. Regards Kaushik (5 Replies)
Discussion started by: kaushikraman
5 Replies

10. Shell Programming and Scripting

regular expression using a variable

hello, I use AIX with ISM PILOT, I want to match something with a varible like this : $variable = 10 #this variable is the number of the job "$variable STARTED" # the pattern how can use this variable to match it with the word STARTED Tanks (0 Replies)
Discussion started by: barribar
0 Replies
Login or Register to Ask a Question
diff3(1)							   User Commands							  diff3(1)

NAME
diff3 - 3-way differential file comparison SYNOPSIS
diff3 [-exEX3] filename1 filename2 filename3 DESCRIPTION
diff3 compares three versions of a file, and publishes disagreeing ranges of text flagged with these codes: ==== all three files differ ====1 filename1 is different ====2 filename2 is different ====3 filename3 is different The type of change suffered in converting a given range of a given file to some other is indicated in one of these ways: f : n1 a Text is to be appended after line number n1 in file f, where f = 1, 2, or 3. f : n1 , n2 c Text is to be changed in the range line n1 to line n2. If n1 = n2, the range may be abbreviated to n1. The original contents of the range follows immediately after a c indication. When the contents of two files are identical, the contents of the lower-numbered file is suppressed. The following command will apply the resulting script to filename1. (cat script; echo '1,$p') | ed - filename1 OPTIONS
-e Produce a script for the ed(1) editor that will incorporate into filename1 all changes between filename2 and filename3 (that is, the changes that normally would be flagged ==== and ====3). -x Produce a script to incorporate only changes flagged ====. -3 Produce a script to incorporate only changes flagged ====3. -E Produce a script that will incorporate all changes between filename2 and filename3, but treat overlapping changes (that is, changes that would be flagged with ==== in the normal listing) differently. The overlapping lines from both files will be inserted by the edit script, bracketed by <<<<<< and >>>>>> lines. -X Produce a script that will incorporate only changes flagged ====, but treat these changes in the manner of the -E option. USAGE
See largefile(5) for the description of the behavior of diff3 when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). FILES
/tmp/d3* /usr/lib/diff3prog ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWesu | |CSI |enabled | +-----------------------------+-----------------------------+ SEE ALSO
diff(1), attributes(5), largefile(5) NOTES
Text lines that consist of a single `.' will defeat -e. Files longer than 64 Kbytes will not work. SunOS 5.10 14 Sep 1992 diff3(1)