LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-14-2015, 11:52 AM   #1
_ZeD_
LQ Newbie
 
Registered: May 2012
Distribution: Slackware
Posts: 26

Rep: Reputation: 1
Question slackpkg search case *in*sensitive


Hi.
is there a way to make slackpkg searches to treat the parameter as a case insensitive search key?
Most of the times, it's not a problem, because the packages are all lowercase, but sometimes (see MPlayer, GConf, OpenAL...) funny uppercase characters appears, and every time I need to double check (it's GConf? gconf? Gconf?...)
 
Old 12-14-2015, 12:49 PM   #2
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

You can use the environment variable GREP_OPTIONS="--ignore-case" (or simply GREP_OPTIONS="-i") on the command line :
Code:
$ GREP_OPTIONS="--ignore-case" slackpkg search mplayer

Looking for mplayer in package list. Please wait... DONE

The list below shows all packages with name matching "mplayer".

[ installed ] - mplayerthumbs-4.10.5-x86_64-1
[ installed ] - phonon-mplayer-1b1fd1f_20110823git-x86_64-1
[ installed ] - MPlayer-1.1_20130819-x86_64-2
[uninstalled] - mplayerplug-in-3.55-x86_64-1

You can search specific files using "slackpkg file-search file"
--
SeB
 
3 members found this post helpful.
Old 12-15-2015, 10:10 PM   #3
_ZeD_
LQ Newbie
 
Registered: May 2012
Distribution: Slackware
Posts: 26

Original Poster
Rep: Reputation: 1
I have a strange problem with GREP_OPTIONS:

i did

Code:
# export GREP_OPTIONS='--ignore-case'
# LC_ALL=C slackpkg search mplayer
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script

grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
DONE

The list below shows all packages with name matching "mplayer".

[ Status           ] [ Repository               ] [ Package                                  ]
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled                                       mplayerplug-in-3.55-x86_64-1              
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
   installed                                        mplayerthumbs-4.14.3-x86_64-2             
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
   installed                                        MPlayer-20150721-x86_64-3                 
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          alienbob                     gnome-mplayer-1.0.9-x86_64-1alien         
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slackonly                    Ater-MPlayer-skin-1.2-x86_64-1_slack      
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slackonly                    ExMplayer-5.0.1-x86_64-4_slack            
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slackonly                    gnome-mplayer-1.0.8-x86_64-1_slack        
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slackonly                    mplayer-codecs64-20061022-x86_64-1_slack  
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slackonly                    smplayer-15.9.0-x86_64-1_slack            
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slackonly                    umplayer-0.97-x86_64-1_slack              
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slackonly                    vitunes-mplayer-2.3-x86_64-1_slack        
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  upgrade              slacky                       MPlayer-20150721-x86_64-3 --> MPlayer-1.1.1-x86_64-1sl  
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slacky                       gnome-mplayer-1.0.8-x86_64-2sl            
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
  uninstalled          slacky                       smplayer-14.3.0-x86_64-1sl                

You can search specific files using "slackpkg file-search file".
 
Old 12-15-2015, 11:53 PM   #4
bormant
Member
 
Registered: Jan 2008
Posts: 426

Rep: Reputation: 240Reputation: 240Reputation: 240
As a temporary workaround:
Code:
GREP_OPTIONS="-i" slackpkg search mplayer 2>/dev/null
 
Old 12-16-2015, 12:50 AM   #5
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Or create an alias in your ~/.bashrc:

Code:
alias grep='/bin/grep -i'

Last edited by Diantre; 12-16-2015 at 12:51 AM. Reason: ~/
 
Old 12-16-2015, 01:00 AM   #6
_ZeD_
LQ Newbie
 
Registered: May 2012
Distribution: Slackware
Posts: 26

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Diantre View Post
Or create an alias in your ~/.bashrc:

Code:
alias grep='/bin/grep -i'
does it works for you? It seems the alias is ignored...

Code:
# alias grep='/usr/bin/grep -i'
# slackpkg search mplayer

DONE

The list below shows all packages with name matching "mplayer".

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled                                       mplayerplug-in-3.55-x86_64-1              
   installed                                        mplayerthumbs-4.14.3-x86_64-2             
  uninstalled          alienbob                     gnome-mplayer-1.0.9-x86_64-1alien         
  uninstalled          slackonly                    gnome-mplayer-1.0.8-x86_64-1_slack        
  uninstalled          slackonly                    mplayer-codecs64-20061022-x86_64-1_slack  
  uninstalled          slackonly                    smplayer-15.9.0-x86_64-1_slack            
  uninstalled          slackonly                    umplayer-0.97-x86_64-1_slack              
  uninstalled          slackonly                    vitunes-mplayer-2.3-x86_64-1_slack        
  uninstalled          slacky                       gnome-mplayer-1.0.8-x86_64-2sl            
  uninstalled          slacky                       smplayer-14.3.0-x86_64-1sl                

You can search specific files using "slackpkg file-search file".


# slackpkg search MPlayer

DONE

The list below shows all packages with name matching "MPlayer".

[ Status           ] [ Repository               ] [ Package                                  ]
   installed                                        MPlayer-20150721-x86_64-3                 
  uninstalled          slackonly                    Ater-MPlayer-skin-1.2-x86_64-1_slack      
  upgrade              slacky                       MPlayer-20150721-x86_64-3 --> MPlayer-1.1.1-x86_64-1sl  

You can search specific files using "slackpkg file-search file".


#
 
Old 12-16-2015, 02:31 AM   #7
bormant
Member
 
Registered: Jan 2008
Posts: 426

Rep: Reputation: 240Reputation: 240Reputation: 240
Quote:
Originally Posted by Diantre View Post
Or create an alias in your ~/.bashrc
man bash says in ALIASES section that
Quote:
Aliases are not expanded when the shell is not interactive, unless the expand_aliases shell option is set using shopt (see the description of shopt under SHELL BUILTIN COMMANDS below.

Code:
grep ()
    /usr/bin/grep -i "$@"
}
export -f grep
makes the trick:
Code:
# slackpkg search gconf

DONE

The list below shows all packages with name matching "gconf".

[ Status           ] [ Repository               ] [ Package                                  ]
   installed                                        GConf-3.2.6-x86_64-1

Last edited by bormant; 12-16-2015 at 02:33 AM.
 
2 members found this post helpful.
Old 12-16-2015, 02:58 AM   #8
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by _ZeD_ View Post
does it works for you? It seems the alias is ignored...
No, it doesn't. Unfortunately, my previous reply was not adequate. My apologies.

As bormant explains, aliases are not inherited in subshells. As an alternative solution, it's possible to use a slackpkg external function just to set the desired options for grep. For instance, create a file called /usr/libexec/slackpkg/functions.d/grep_options.sh and make it executable.

This file would only contain one line:

Code:
export GREP_OPTIONS="-i"
Unlike a global exported function, a slackpkg function would only be available to slackpkg itself, in case you need to use grep without the "-i" option in the command line or from another script.
 
Old 12-16-2015, 06:27 AM   #9
_ZeD_
LQ Newbie
 
Registered: May 2012
Distribution: Slackware
Posts: 26

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by bormant View Post
man bash says in ALIASES section that
Code:
grep ()
    /usr/bin/grep -i "$@"
}
export -f grep
makes the trick
yes! thank you!
Code:
# (function grep() { /usr/bin/grep -i "${@}"; }; export -f grep; slackpkg search mplayer)

DONE

The list below shows all packages with name matching "mplayer".

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled                                       mplayerplug-in-3.55-x86_64-1              
   installed                                        mplayerthumbs-4.14.3-x86_64-2             
   installed                                        MPlayer-20150721-x86_64-3                 
  uninstalled          alienbob                     gnome-mplayer-1.0.9-x86_64-1alien         
  uninstalled          slackonly                    Ater-MPlayer-skin-1.2-x86_64-1_slack      
  uninstalled          slackonly                    ExMplayer-5.0.1-x86_64-4_slack            
  uninstalled          slackonly                    gnome-mplayer-1.0.8-x86_64-1_slack        
  uninstalled          slackonly                    mplayer-codecs64-20061022-x86_64-1_slack  
  uninstalled          slackonly                    smplayer-15.9.0-x86_64-1_slack            
  uninstalled          slackonly                    umplayer-0.97-x86_64-1_slack              
  uninstalled          slackonly                    vitunes-mplayer-2.3-x86_64-1_slack        
  upgrade              slacky                       MPlayer-20150721-x86_64-3 --> MPlayer-1.1.1-x86_64-1sl  
  uninstalled          slacky                       gnome-mplayer-1.0.8-x86_64-2sl            
  uninstalled          slacky                       smplayer-14.3.0-x86_64-1sl                

You can search specific files using "slackpkg file-search file".


#
 
  


Reply

Tags
search, slackpkg



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Makefile case sensitive smaartguy Linux - Newbie 3 02-23-2013 05:08 PM
Copying files from case-sensitive Linux to case-insensitive Windows via CIFS? SlowCoder Linux - General 4 05-07-2008 07:03 PM
is apache case-sensitive? browny_amiga Linux - Software 2 06-21-2004 01:57 PM
mySQL LIKE search is case sensitive? icepig Linux - Software 4 11-14-2003 04:29 PM
case sensitive groupadd? sysmaster Linux - General 0 07-28-2003 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration