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
Sed variable substitution when variable constructed of a directory path alrinno Shell Programming and Scripting 2 07-11-2008 03:24 PM
Declaring Global Variables in KLD int80h BSD 1 01-21-2008 09:11 AM
Declaring functions in CSH tipsy Shell Programming and Scripting 4 01-22-2007 04:54 PM
Declaring Local Arrays ksh Shell Programming and Scripting 1 02-22-2005 09:16 AM
Declaring variable environments in .cshrc v_sharda UNIX for Dummies Questions & Answers 2 09-23-2002 11:25 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-21-2009
neverhood neverhood is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 8
declaring variable with for $(seq)

Hi guys. i have the following script:


Code:
1 #!/bin/bash
  2 linkcount=$(grep "/portal" tickets | wc -l)
  3 grep "/portal" tickets  > links
  4 for i in $(seq 1 $linkcount); do
  5 echo "BLYAT"
  6 let link$i=$(sed -n "$i"p links)
  7 echo $[link$i]
  8 done

the problem is, that "let" can`t define the variable, as variable looks like "/portal/ticket/show/090107-01666?status=open".
as you can see script should define a number of line(1-x) variables and echo them
Could you please suggest some options?
 

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 02:25 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