how to suppress list number from history command output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to suppress list number from history command output
# 1  
Old 11-23-2008
how to suppress list number from history command output

i run history command and I want to eliminate the list number.
So far this perl script works as long as the list is a exact 3 character
long.

cat dd | perl -pe 's,\d{3},,'
70 export JAVA_HOME=.
81 export JAVA_HOME=.
82 export JAVA_HOME=`pwd`
export JAVA_HOME=`pwd`
export JAVA_HOME=`pwd`
export JAVA_HOME=jdk1.5.0_15/
export JAVA_HOME=`pwd`/jdk1.5.0_15/
historyhistory | grep export
history | grep export
history | grep export > dd
history | grep export > dd


I have tried, but no good.
Code:
perl -pe 's,\d{0,3},,'

How would you simply remove the list number?
It does not have to be with perl as I tried and I thought
Code:
history -n

will do, but it returns no output
as opposed to my expectation.
# 2  
Old 11-23-2008
try this one
history | sed 's/[0-9][0-9]*//'


thnx Shishir
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Want to get list of Linux commands used on specific date through HISTORY command

I want to get list of linux commands used on Jan 01 2014 with the help of HISTORY command or some other linux commands,. Kindly help. (3 Replies)
Discussion started by: karthick nath
3 Replies

2. Shell Programming and Scripting

How to suppress error in following command?

I have a file containing data in multiple columns. The colums are seperated by pipe (|). I need to extract information as below: myfile_20130929_781;10;100.00 where myfile.txt is the file name. 10 is the number of records in the file starting with 120 and 100.00 is the sum of 26th field of... (16 Replies)
Discussion started by: angshuman
16 Replies

3. Shell Programming and Scripting

Extract particular number from the command output

Hi Folks, I want to use particular number as a variable output..Please find the below for scenario... Example 1:- Below output i want to use secondary group 9003 as a variable output $ id -a |awk -NF '{print $3}' groups=99(local),9003(testadmin) Else I want to use 2006 as a... (8 Replies)
Discussion started by: susindram
8 Replies

4. Shell Programming and Scripting

list files command output

Hi All, Below is the 2 different ouputs of the command "ls -lrt", my question is what exactly "total 0" & "total 8" means here ? $ ls -rtl total 0 -rw-r--r-- 1 oracle dba 0 Feb 10 20:16 c -rw-r--r-- 1 oracle dba 0 Feb 10 20:16 b -rw-r--r-- 1... (1 Reply)
Discussion started by: kannan84
1 Replies

5. Shell Programming and Scripting

How to selectively suppress perl output?

The following perl statement in a bash script consists of two substatements. I intend the first perl substatement (the assignment with glob) to get input from the preceding bash pipe, and the second perl substatement (the foreach loop) to output back to bash. However, the first perl substatement... (7 Replies)
Discussion started by: LessNux
7 Replies

6. HP-UX

glance adviser suppress newline in print command

Hi, I have a glance adviser, the highlights below. The problem that i have is that every time glance finds process name "abc" it write the memory region data in a new line. My question is if i have a way to print without newline? The output line for process abc looks something like this:... (0 Replies)
Discussion started by: yochaia01
0 Replies

7. UNIX for Dummies Questions & Answers

The history command: See other users command history

Can anyone tell this: If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used. Thanks in advance for your help. Iamnew2solaris (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

8. Shell Programming and Scripting

Suppress the output of ping

Hi All, I just wanted to know, is there a way to suppress the output of the following i.e. the output should not be written on the screen: ping 10.1.23.234 -n 1 PING 10.1.23.234: 64 byte packets 64 bytes from 10.1.23.234: icmp_seq=0. time=0. ms ----10.1.23.234 PING Statistics---- 1... (2 Replies)
Discussion started by: ss_ss
2 Replies

9. Shell Programming and Scripting

how to suppress dd output?

I have to stop the output of dd from writing to terminal. Here is the command: sudo dd if=boot1h of="/dev/r$temp1" Here is the output: 2+0 records in 2+0 records out 1024 bytes transferred in 0.000804 secs (1273715 bytes/sec) I have tried >> log.txt but it doesn't work. Is there... (4 Replies)
Discussion started by: msf5042
4 Replies

10. Shell Programming and Scripting

flags to suppress column output, # of rows selected in db2 sql in UNIX

Hello, I am new to db2 SQL in unix so bear with me while I try to explain the situation. I have a text file that has the contents of the where condition that I am using for a db2 SQL in UNIX ksh. Here is the snippet. if ; then echo "Begin processing VALUEs" ... (1 Reply)
Discussion started by: jerardfjay
1 Replies
Login or Register to Ask a Question