The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
VIM tabs... xyzt UNIX and Linux Applications 2 06-10-2008 02:27 PM
Color those tabs! iBot UNIX and Linux RSS News 0 12-10-2007 05:40 AM
removing certain tabs djkane Shell Programming and Scripting 2 08-17-2006 06:58 AM
removing tabs nbvcxzdz Shell Programming and Scripting 7 03-29-2005 11:49 AM
Cron Tabs rocker40 UNIX for Dummies Questions & Answers 1 12-23-2003 12:10 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-03-2008
echo echo is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 1
cat command in sh and tabs

Hi guys, I'm writing an assignment for a programming course and I'm using cat to cat out 8 lines of a file to be used later
curSection=`cat $FILENAME|head -$start|tail -8`
I found that if the original file contains tabs in those lines, curSection will not have tabs but a space for each tab. I need to keep track of the tabs that existed in the original, any ideas how to do this?(tabs and spaces both exist in the original) As simple as possible please

many thanks

Jay
  #2 (permalink)  
Old 10-03-2008
nullwhat nullwhat is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 25
see

man tab
  #3 (permalink)  
Old 10-03-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,441
OP should use double quotes:

Code:
echo "$curSection"

  #4 (permalink)  
Old 10-04-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,418
or else use

Code:
print "$curSection"

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0