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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script related query gopsman Shell Programming and Scripting 1 12-02-2007 09:50 PM
executing a SQL query in shell script lijju.mathew Shell Programming and Scripting 1 05-17-2007 08:29 AM
Query on a shell script logic tipsy Shell Programming and Scripting 1 06-29-2006 02:38 PM
Connecting DB in the Shell Script to do SQL Query mehuldoshi UNIX for Advanced & Expert Users 3 03-29-2003 09:47 AM
Executing a SQL query from a shell script 98_1LE UNIX for Dummies Questions & Answers 3 03-23-2002 12:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-13-2008
Registered User
 

Join Date: May 2008
Posts: 1
C Shell Script query

Hi

I need a small help

Cshell% more abc.txt
********
Cshell% cat abc.txt | cut -c1-3
***
Cshell%set test3=`cat abc.txt | cut -c1-3`
Cshell%echo $test3
a.txt b.txt.................
.....
It displays all the file in the current directory.


I want *** to be displayed.

Can any one of you provide a quick suggesstion in this ?
Reply With Quote
Forum Sponsor
  #2  
Old 05-13-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
The shell is interpreting the contents of the env var - in this case it's '***' which is translates to "All files in the cirrent directory"

Try echo "$test3" instead (ie escape it)
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0