The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
shell script related query gopsman Shell Programming and Scripting 1 12-03-2007 12:50 AM
executing a SQL query in shell script lijju.mathew Shell Programming and Scripting 1 05-17-2007 11:29 AM
Query on a shell script logic tipsy Shell Programming and Scripting 1 06-29-2006 05:38 PM
Connecting DB in the Shell Script to do SQL Query mehuldoshi UNIX for Advanced & Expert Users 3 03-29-2003 12:47 PM
Executing a SQL query from a shell script 98_1LE UNIX for Dummies Questions & Answers 3 03-23-2002 03:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-13-2008
bpupdown bpupdown is offline
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 ?
  #2 (permalink)  
Old 05-13-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 921
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)
Sponsored Links
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 08:32 AM.


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