# using cut command

**URL:** <https://community.unix.com/t/using-cut-command/168178>\
**Category:** Chat with Bot\
**Created:** [January 10, 2007, 3:47am UTC](https://community.unix.com/t/using-cut-command/168178 "2007-01-10T03:47:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brain\_full](https://community.unix.com/letter_avatar/brain_full/32/5_5575768a8748004e209b776fc1b2916d.png) [@brain\_full](https://community.unix.com/u/brain_full)\
**Post date:** [January 10, 2007, 3:47am UTC](https://community.unix.com/t/using-cut-command/168178/1 "2007-01-10T03:47:27Z")

</div>

i have a file and i want to use cut command in my program.  
file has data as  
34  
154  
189  
200  
....  
numbers in diff row and i want to access these numbers one by one by passing argument as interger (1 then 2 the 3 .....) for each row and want to get these no stored in a variable  
I used command as  
a=`cut -f$i-$i filename`  
but i do not succeeded  
Do i use sed instead of cut  
Plz help me.  
(Actually i want to access groupid from /etc/group and the make them uniq then i wanted the name of user associated with that groupid)

---

<div class="post-metadata">

**Author:** ![Gollum](https://community.unix.com/user_avatar/community.unix.com/gollum/32/160_2.png) [@Gollum](https://community.unix.com/u/Gollum)\
**Post date:** [January 10, 2007, 3:47am UTC](https://community.unix.com/t/using-cut-command/168178/2 "2007-01-10T03:47:30Z")

</div>

> [@brain\_full](#):
>
> i have a file and i want to use cut command in my program.  
> file has data as  
> 34  
> 154  
> 189  
> 200  
> ....  
> numbers in diff row and i want to access these numbers one by one by passing argument as interger (1 then 2 the 3 .....) for each row and want to get these no stored in a variable  
> I used command as  
> a=`cut -f$i-$i filename`  
> but i do not succeeded  
> Plz help me.  
> (Actually i want to access groupid from /etc/group and the make them uniq then i wanted the name of user associated with that groupid)

Cool. I have a great botmaster.  
file  
Interesting. I want to find out more about you.Where did file get data as34154189200?Can you please rephrase that with fewer ideas, or different thoughts?  
Your purpose is each row and want to get these no stored in a variable he or she used command as acut -f$he or she-$he or she filenamebut he or she do not succeeded Plz help me.Actually you don't say. Interesting. I want to find out more about you.

---

<div class="post-metadata">

**Author:** ![blowtorch](https://community.unix.com/user_avatar/community.unix.com/blowtorch/32/136_2.png) [@blowtorch](https://community.unix.com/u/blowtorch)\
**Post date:** [January 10, 2007, 6:44pm UTC](https://community.unix.com/t/using-cut-command/168178/3 "2007-01-10T18:44:54Z")

</div>

There there, gollum. Don't hurt yourself. You aren't old enough to answer questions such as this yet.

See you around.

---

<div class="post-metadata">

**Author:** ![Gollum](https://community.unix.com/user_avatar/community.unix.com/gollum/32/160_2.png) [@Gollum](https://community.unix.com/u/Gollum)\
**Post date:** [January 10, 2007, 6:44pm UTC](https://community.unix.com/t/using-cut-command/168178/4 "2007-01-10T18:44:57Z")

</div>

> [@blowtorch](#):
>
> There there, gollum. Don't hurt yourself. You aren't old enough to answer questions such as this yet.
> 
> See you around.

"There you go again."--ReaganOk I'll try not to do

```
				hurt yourself
			
		 too much.You know what you do, when you assume.Bye for now.

```
