Sponsored Content
Top Forums Shell Programming and Scripting Ls help: ls not working with start character search (^) Post 302785949 by rveri on Tuesday 26th of March 2013 03:09:20 PM
Old 03-26-2013
Ls help: ls not working with start character search (^)

Experts,

How to list a file using ^ character, for all files started with character a. (os= hp-ux )

Code:
# ls -l 
-rw-------   1 useradm    users            0 Mar 26 14:30 abc
-rw-------   1 useradm    users            0 Mar 26 14:30 def
-rw-------   1 useradm    users            0 Mar 26 14:33 zyx
#


Code:
Trying but not working, any idea whats wrong, 
# ls -l ^abc
^abc not found

# ls -l ^a*
^a* not found

# ls ^a*
^a* not found



Thanks a lot.

---------- Post updated at 03:09 PM ---------- Previous update was at 02:46 PM ----------

Also can anyone please explain , how the ^ character not working with
Code:
ls

, for regex.




Did not work with ls: # Wanted to list which is not having first letter a .
Code:
Code:
# ls -l [^a]bc
-rw-------   1 useradm   users            0 Mar 26 14:30 abc


Worked with grep: # Wanted to list which is not having first letter a .
Code:
# ls -l | grep "[^a]bc"
-rw-------   1 useradm   users            0 Mar 26 14:48 bbc


Thanks a lot.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Working out end time from start + elapsed

Hi, I'm writing a script and have become stuck trying to define a variable (COMP) by adding an elapsed time (ELAPSE e.g 00:55) to a start time (START e.g 23:50). Can anybody give me a solution as to how I can get a completion time in hh:mm from the variables above? thanks Richard (4 Replies)
Discussion started by: rik1551
4 Replies

2. Shell Programming and Scripting

read a string from its end to its start and stop when you find a specific character

How can I do this? Actually I have a file which contains a path e.g. /home/john/Music/hello.mp3 and I want to take only the filename (hello.mp3) So, I need to read the file from its end to its start till the character "/" Is this possible? Thanks, I am sure you'll not disappoint me here! Oh,... (9 Replies)
Discussion started by: hakermania
9 Replies

3. Solaris

Solaris 10, start inetd in a zone not working

Hello all, I`ve the following problem - I cannot start inetd in any way possible: bash-3.00# svcs inetd STATE STIME FMRI offline Jul_30 svc:/network/inetd:default bash-3.00# bash-3.00# svcadm enable -r inetd bash-3.00# svcs inetd STATE STIME FMRI... (6 Replies)
Discussion started by: click
6 Replies

4. Slackware

pppoe-start not working

Hello. I'm new here and i'm new to slack (concept) as well. I made a connection for pppoe with pppoe-setup, bringed up eth0 with ifconfig but when i try pppoe-connect i get "Cannot determine ethernet address for proxy ARP" and with pppoe-start i get "child pppd process terminated". How can i make... (0 Replies)
Discussion started by: editheraven
0 Replies

5. Shell Programming and Scripting

escape character not working

I need to change a pattern with single quotes # echo "serversignature: 'On'" serversignature: 'On' I did # echo "serversignature: 'On'" | sed 's/.*serversignature.*/serversignature: 'Off'/' serversignature: Off The output I need is with single quotes. But its swallowing it. ... (2 Replies)
Discussion started by: anilcliff
2 Replies

6. Shell Programming and Scripting

How to start working with GNU PLOT??

Dear Experts, I wanted to plot a graph with respect to values from a file. I'm doing it with Excel 2007, but I want to create the chart in script itself. I searched in internet for GNUPLOt. But I couldn't understand anything. Here is my situation. I have a file having values separated by "|".... (7 Replies)
Discussion started by: Naga06
7 Replies

7. Shell Programming and Scripting

how to specify start and stop of a search string

I am trying to extract a string from a line of text. Currently I am using grep -o 'startofstring(.........' The string is not always the same size. The string I'm trying to extract starts with 'test(' ends with ')'. ex "blah,blah,blah,test(stringoftext),blah blah" How do I... (4 Replies)
Discussion started by: jeepguy
4 Replies

8. UNIX for Dummies Questions & Answers

Appending a character(#) with string search at the start of the line

Hello, I have been browsing through the forum, but unable to find a solution for my requirement. I need to go through a file and search for /home/users and insert a # symbol at the start /home/users. Example output is #/home/users. Can you please help me with the awk or sed command for... (1 Reply)
Discussion started by: chandu123
1 Replies

9. Shell Programming and Scripting

Perl - start search by using search button or by pressing the enter key

#Build label and text box $main->Label( -text => "Input string below:" )->pack(); $main->Entry( -textvariable => \$text456 )->pack(); $main->Button( -text => "Search", -command => sub { errchk ($text456) ... (4 Replies)
Discussion started by: popeye
4 Replies

10. Shell Programming and Scripting

How can I search with start and end criteria?

Hello I'm using cygwin and wouldlike extract information from an xml file according specific values, but don't know how. Let's say in a file content looks like this: <tab> SURNAME=Mustermann NAME=Max CUSTOMER SINCE= 18.01.2000 ADDRESS=Birmingham ... (2 Replies)
Discussion started by: witchblade
2 Replies
IRSEND(1)								FSF								 IRSEND(1)

NAME
irsend - basic LIRC program to send infra-red commands SYNOPSIS
irsend [options] DIRECTIVE REMOTE CODE [CODE...] DESCRIPTION
Asks the lircd daemon to send one or more CIR (Consumer Infra-Red) commands. This is intended for remote control of electronic devices such as TV boxes, HiFi sets, etc. DIRECTIVE can be: SEND_ONCE - send CODE [CODE ...] once SEND_START - start repeating CODE SEND_STOP - stop repeating CODE LIST - list configured remote items SET_TRANSMITTERS - set transmitters NUM [NUM ...] SIMULATE - simulate IR event REMOTE is the name of a remote, as described in the lircd configuration file. CODE is the name of a remote control key of REMOTE, as it appears in the lircd configuration file. NUM is the transmitter number of the hardware device. For the LIST DIRECTIVE, REMOTE and/or CODE can be empty: LIST "" "" - list all configured remote names LIST REMOTE "" - list all codes of REMOTE LIST REMOTE CODE - list only CODE of REMOTE The SIMULATE command only works if it has been explicitly enabled in lircd. -h --help display usage summary -v --version display version -d --device use given lircd socket [/var/run/lirc/lircd] -a --address=host[:port] connect to lircd at this address -# --count=n send command n times EXAMPLES
irsend LIST DenonTuner "" irsend SEND_ONCE DenonTuner PROG-SCAN irsend SEND_ONCE OnkyoAmpli VOL-UP VOL-UP VOL-UP VOL-UP irsend SEND_START OnkyoAmpli VOL-DOWN ; sleep 3 irsend SEND_STOP OnkyoAmpli VOL-DOWN irsend SET_TRANSMITTERS 1 irsend SET_TRANSMITTERS 1 3 4 irsend SIMULATE "0000000000000476 00 OK TECHNISAT_ST3004S" FILES
/etc/lirc/lircd.conf Default lircd configuration file. It should contain all the remotes, their infra-red codes and the corresponding timing and wave- form details. DIAGNOSTICS
If lircd is not running (or /var/run/lirc/lircd lacks write permissions) irsend aborts with the following diagnostics: "irsend: could not connect to socket" "irsend: Connection refused" (or "Permission denied"). SEE ALSO
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory. lircd(8), mode2(1), smode2(1), xmode2(1), irrecord(1), irw(1), http://www.lirc.org. irsend 0.8.7pre1 May 2010 IRSEND(1)
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy