Sponsored Content
Full Discussion: cat > variable + format
Top Forums Shell Programming and Scripting cat > variable + format Post 302342944 by Scott on Tuesday 11th of August 2009 05:59:05 AM
Old 08-11-2009
Hi.

There should be no spaces on either side of the = sign.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

variable= 'cat file|wc -l' String problems

Hi, does anybody knows about wc -l, how to transform it inot a just number? this script ALWAYS executes the command3!!, However, the value of BMU_RUNNING is 1 case $BMU_RUNNING in *0) command1 ;; *1) command 2;; *)command 3;; esac The... (3 Replies)
Discussion started by: Santiago
3 Replies

2. UNIX for Dummies Questions & Answers

Using a variable inside a file to cat another.

I have a question to do and it's somewhat confusing. It says, and I quote "Create a file called file_1 with three lines of text in it. Create a shell variable called "f_name", assign it the string "file_1". Use the cat command and the variable "f_name" to display the contents of the file... (3 Replies)
Discussion started by: MaestroRage
3 Replies

3. Shell Programming and Scripting

redirect cat to variable

hello just i saw a really strange for cat i have file (file1) contains line /home/rajiv/proj1/*.txt now applied a commonds DDPATH="$(cat file1)" echo $DDPATH it shows all the txt files in that folder like /home/rajiv/proj1/read1.txt /home/rajiv/proj1/read2.txt... (7 Replies)
Discussion started by: shailesh_arya
7 Replies

4. Shell Programming and Scripting

Split variable length and variable format CSV file

Dear all, I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file. The file length will depend on the numbers of Earnings/Deductions/Direct Deposits. And The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Discussion started by: chechun
2 Replies

5. Shell Programming and Scripting

script help Undefined /illegal variable using cat

Hello group, Still fairly new at the whole scripting thing so be gentle. I'm trying to write a simple script that archives my log files into a master log broken into weeks of the year. My script runs fine up till the "cat" lines which I get a undefined or illegal variable name error. But... (2 Replies)
Discussion started by: dpreviti
2 Replies

6. UNIX for Dummies Questions & Answers

format values in a text file using cat command

Hello... Is it possible that we can change the format of the values we entered in a text file using cat? Like for example, I will create a text file names.txt using cat and as I save the names and view the text file... the format will be like this ... (5 Replies)
Discussion started by: kpopfreakghecky
5 Replies

7. Shell Programming and Scripting

cat file with variable substitution

MyFile contains: ALTER TABLE $DBN.$TBN ADD $COL $TYP COMPRESS ($VAL); I need to cat the file and have it substitute all of the variables with their contents. cat MyFile does not work. The following works for the first line, but errors on the second line because of the paren: $ while read... (2 Replies)
Discussion started by: Phil27577
2 Replies

8. Shell Programming and Scripting

Moving cat values to a variable

I have a file created as ABC!DEF@2014.txt My if condition is based on 2014 so I need to move it to variable. So while I can do this on console screen - ls ABC* -l > test.txt cat test.txt | cut -f 2 -d "@" | cut -f 1 -d "." to get the value - 2014 I am a bit at loss how to achieve this... (4 Replies)
Discussion started by: rajiv_kool
4 Replies

9. UNIX for Beginners Questions & Answers

Carriage return with cat variable

Hi, I wish to know how to works the carriage return with cat.. As a picture often speaks better than words, my code below : #te=`cat text.txt` (I tried this, but the same..) te=$(cat text.txt) echo $te My file text.txt below: BLABLABLABLABLALBLA BLABLABLABLABLALBLA ... (9 Replies)
Discussion started by: Arnaudh78
9 Replies

10. Shell Programming and Scripting

Bash - Trying to cat a file that is a variable

Thank you in advance for looking at this, I've scoured the internet and can't find the answer I'm looking for!! - I am new at bash script so please bare with me!! I have a script where I've identified individual files within a folder, the filename is then stored as a variable ($filename):... (3 Replies)
Discussion started by: paperbackwriter
3 Replies
SDIFF(1)						    BSD General Commands Manual 						  SDIFF(1)

NAME
sdiff -- side-by-side diff SYNOPSIS
sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1 file2 DESCRIPTION
sdiff displays two files side by side, with any differences between the two highlighted as follows: new lines are marked with '>'; deleted lines are marked with '<'; and changed lines are marked with '|'. sdiff can also be used to interactively merge two files, prompting at each set of differences. See the -o option for an explanation. The options are: -l Only print the left column for identical lines. -o outfile Interactively merge file1 and file2 into outfile. In this mode, the user is prompted for each set of differences. See EDITOR and VISUAL, below, for details of which editor, if any, is invoked. The commands are as follows: l Choose left set of diffs. r Choose right set of diffs. s Silent mode - identical lines are not printed. v Verbose mode - identical lines are printed. e Start editing an empty file, which will be merged into outfile upon exiting the editor. e l Start editing file with left set of diffs. e r Start editing file with right set of diffs. e b Start editing file with both sets of diffs. q Quit sdiff. -s Skip identical lines. -w width Print a maximum of width characters on each line. The default is 130 characters. Options passed to diff(1) are: -a Treat file1 and file2 as text files. -b Ignore trailing blank spaces. -d Minimize diff size. -I regexp Ignore line changes matching regexp. All lines in the change must match regexp for the change to be ignored. -i Do a case-insensitive comparison. -t Expand tabs to spaces. -W Ignore all spaces (the -w flag is passed to diff(1)). ENVIRONMENT
EDITOR, VISUAL Specifies an editor to use with the -o option. If both EDITOR and VISUAL are set, VISUAL takes precedence. If neither EDITOR nor VISUAL are set, the default is vi(1). TMPDIR Specifies a directory for temporary files to be created. The default is /tmp. SEE ALSO
diff(1), diff3(1), vi(1), re_format(7) AUTHORS
sdiff was written from scratch for the public domain by Ray Lai <ray@cyth.net>. CAVEATS
Although undocumented, sdiff supports all options supported by GNU sdiff. Some options require GNU diff. Tabs are treated as anywhere from one to eight characters wide, depending on the current column. Terminals that treat tabs as eight charac- ters wide will look best. BUGS
sdiff may not work with binary data. BSD
February 21, 2007 BSD
All times are GMT -4. The time now is 04:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy