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
grep command christine33990 UNIX for Dummies Questions & Answers 11 05-06-2008 03:45 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-05-2007 03:59 AM
grep command help ishmael^soyuz Shell Programming and Scripting 4 07-11-2007 10:01 AM
grep command pmsuper UNIX for Dummies Questions & Answers 6 11-22-2006 07:12 AM
grep command debasis.mishra Shell Programming and Scripting 1 03-28-2006 02:53 AM

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 09-15-2007
ranga27 ranga27 is offline
Registered User
  
 

Join Date: May 2006
Posts: 63
Help need in Grep Command

Hi

I am assaging a variable like this

current_dir ='ps -o user|grep -v'USER'|uniq' #this would print the user id "

v_name=`date +%m%d%y`
outputfile =$v_name$current_dir.txt

this gives the output file with timeanddate .txt but not the userid

lets assume i have the userrid called uuuu1 and time 1507

the output file should be uuuu11507.txt

can you help me on this !!!!!!!!!
  #2 (permalink)  
Old 09-15-2007
ranga27 ranga27 is offline
Registered User
  
 

Join Date: May 2006
Posts: 63
i found the solution for it .. the issue was the quotes

but a small problem here it prints with a space

modified uuuuu11507.txt

how to trim those spaces
  #3 (permalink)  
Old 09-15-2007
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by ranga27 View Post
i found the solution for it .. the issue was the quotes

but a small problem here it prints with a space

modified uuuuu11507.txt

how to trim those spaces

What spaces?

What is the script you are using?

  #4 (permalink)  
Old 09-16-2007
udaykishore udaykishore is offline
Registered User
  
 

Join Date: May 2006
Location: London
Posts: 19
current_dir ='ps -o user|grep -v'USER'|uniq' #this would print the user id "

v_name=`date +%m%d%y`

Assuming current_dir has username and v_name has date and time.

file name u should use

${current_dir}${v_name}.txt

Ur filename looks like uday101007.txt
  #5 (permalink)  
Old 09-16-2007
robotronic's Avatar
robotronic robotronic is offline Forum Advisor  
Can I play with madness?
  
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Uh sorry... Post deleted
Closed Thread

Bookmarks

Tags
awk, awk trim, trim, trim awk

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:59 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