Home » Unix » Page 5

I’m writing something that deals with file matches, and I need an
inversion operation. I have a list of files (e.g. from find .
-type f -print0 | sort -z >lst
), and a list of matches (e.g.
from grep -z foo lst >matches), and now I want to
invert this list.



Background: I’m sorta implementing something like href="https://www.mirbsd.org/man1/find" rel="nofollow">find(1)
excepton file lists (although the files do exist in the filesystem at
the point of calling, the list may have been pre-filtered). If the
list of files weren’t potentially so large, I could use find
"${files[@]}" -maxdepth 0 -somecondition -print0
, but even
moderate use of what I’m writing would go beyond the Linux or BSD
argv size limit.



If the lines were not NUL-separated, I could use comm -23 lst
matches >inverted
. If the matches were not NUL-separated, I
could use grep -Fvxzf matches lst. But, from the
generators I mentioned in the first paragraph, both are.



If it helps, assume GNU tools are installed, so this needs not be
portable beyond e.g. Debian, as I’m using find -print0,
sort -z and friends already (although some BSDs have it,
so if it can be done in “more portable”, I won’t complain).

I'm using bind -x to execute a script whenever a
certain key sequence is pressed.



For example I have a script at /usr/local/bin/foo with
the contents



#!/bin/bash
echo foo


If I run bind -x '" ": /usr/local/bin/foo' then every
time I press the space bar twice it echos "foo". So far so good.



What I want to be able to do is access (and ideally modify) the
current command that's being entered. If I type some really
long command
(there are two spaces at the end) my script gets
executed but how can it see that I've already entered some
really long command
and change it to some other long
command
?

How can we concatenate results from stdout (or stderr) and a file
into a final file.



For example



ls -a | grep text1


concatenate with file2.txt into a final result (not
file2.txt), without storing grep text1 to
something intermediate such as grep text1 >
file1.txt

I'm installing "Red Hat Enterprise Linux 7.2 (Linux version
3.10.0-327.el7.x86_64 (mockbuild@x86-034.build.eng.bos.redhat.com)
(gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Oct
29 17:29:29 EDT 2015)"



I am trying to switch from LANG="en_US.UTF-8" to
LANG="en_US" as we need to operate the OS in 8 bits ASCII
mode.



I have tried to change /etc/locale.conf and
reboot.



It doesn't work for gnome. For instance, when I try to launch a
terminal session, I get this error:



Dec 23 14:27:56 cmt22 gnome-session: Error constructing
proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error
calling StartServiceByName for org.gnome.Terminal:
GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process
/usr/libexec/gnome-terminal-server exited with status 8


Accordingly to href="https://wiki.gnome.org/Apps/Terminal/FAQ#Exit_status_8"
rel="nofollow">gnome documentation, it says the locale is not
defined but localectl list-locales shows it is
defined.

I want a (heavily) customized DE, not so much in its style as
content aspects. I want a DE w/ minimal default content but full DE
functionality, i.e. windows, desktop, icons, menu, application
(launcher) panel and system tray. As is known, most distros may break
if you remove some of their default applications; for the same reason,
you shouldn't mix applications of different DEs. So the question is,
how to achieve my goal? What would be better (more feasible):




  1. Configuring a fully functional (see above) DE out of a WM (e.g.
    Openbox),

  2. Installing a maximally stripped-down version of a DE,



and how to achieve either of the two. I suppose in Arch Linux both
should be doable but I want to know what's more feasible. Also,
perhaps there are other distros particularly suited for either of
these tasks (and for which one)? For example, what's the ostensible
difference between Xubuntu and Arch w/ Xfce? Is it the number of
default applications or (mainly) just synaptic vs. pacman?



Note that I do not want to create a new distro or DE. Also, a
netinstall is not an option (I've only a wwan connection that most
Linux installers cannot handle), so e.g. #!++ and BunsenLabs Linux are
ruled out

I installed Group "XYZ" without optional packages.



How do I install the group with optional packages, without removing
and reinstalling it?

I've recently updated Wireshark on OSX El Capitan from 1.12.0 to
2.0.0. The newer stable release uses the Qt interface instead of the
old X11 but the new UI is a lot buggy for me and I want the old
interface without downgrading. The release notes state that I have to
install wireshark through Homebrew for GTK.



I've already brew install wireshark with gtk+3
support but launching wireshark with that UI requires
wireshark-gtk through Terminal while launching the
app invokes the Qt UI. Do I need to modify the Package
Contents
of the Wireshark.app?



How should I do so, so that when I double click Wireshark it opens
the old interface?

so the command is :



echo "abc 123" | sed "s/[0-9]*/h/g"


and im getting output as



hahbhch h


how am i getting this output?



the output i expected it to be is abc h



which im getting by this command :



echo "abc 123" | sed "s/[0-9][0-9]*/h/g"


can someone explain this..

My application is to do a secure erase on my system disk (an SSD)
using hdparm
from a shell script. So my thoughts were:




  1. create a ramdisk

  2. copy the linux OS to the ramdisk

  3. unmount the original system drive

  4. do a secure erase



I created the ramdisk and mounted it, but when I do a pivot_root,
it can't find any of the applications. I copied all of /bin and /sbin
to the ramdisk.

Using Cygwin, I installed Environment Modules. Every time I run a
module command, I get



init.c(718):WARN:165: Cannot set TCL variable '!::'


I've traced this down to the fact that Cygwin has the following
environment variable set:



$ env | grep ::
!::=::


Does anyone know what this is, where it is set, why it might be
necessary, or how to get rid of it?



I might add that it's exceedingly difficult to Google, or even get
to display correctly in Markdown.


- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow