Tag Info

New answers tagged

0

Without admin rights to access the registry, I used the suggestion of this link and fixed the issue: http://www.goodnerdhelp.com/unable-search-windows-7-windows-find-searchquerysummative-solved/ In accordance with the Stack Overflow tradition, I am copying the original content of above link in case it goes away in the future. The steps: 1st – Right click ...


0

lkchoi and ndim solutions didn't worked for me. So I create a system which I call "Cesar", if the songs is bad, I remove it, if it's good move to another folder. This is useful when selecting audios, for example that WhatApp backup, which is an important recording? Filtering songs in a huge Hair Metal package I also used, it's simple: mplayer */*/*3 | ...


1

This Ubuntu documentation talks about ~/.pam_environment: Session-wide environment variables Suitable files for environment variable settings that should affect just a particular user (rather than the system as a whole) are ~/.pam_environment and ~/.profile. After having edited one of those files, you should re-login in order to ...


4

$ echo "word" -n | md5sum 3a21ca21563e9535a9012daef61a0bdf - $ echo "word -n" | md5sum 3a21ca21563e9535a9012daef61a0bdf - $ echo "-n" word | md5sum c47d187067c6cf953245f128b5fde62a - Specifically, note that: $ echo "word" -n word -n All options must come before non-option arguments. This is the case in most programs except some GNU utilities, and is ...


0

thiagowfx solution is preferable to me, since I usually try to avoid context-dependency. However, in order for it to work I had to add loading comint mode first: (progn(require 'comint) (define-key comint-mode-map (kbd "<up>") 'comint-previous-input) (define-key comint-mode-map (kbd "<down>") 'comint-next-input))


2

No need to build a watcher script, check the timeout command. timeout 2h your_python_script This command will kill your_python_script if it's still running after 2 hours.


2

Remove the spaces around the =; that syntax is invalid. Put the line into ~/.bashrc (assuming you use the Bash shell).


0

Please note - this forum is not coding service. This is partial help. Use crontab -e to create this line: 50 13 * * * /path/to/my/script.sh 2>>/path/to/my/logfile Create the script in an editor - this uses mv which changes the location of the file: #!/bin/bash # script.sh now=$(date +%Y_%m_d) mv /path/to/files/${now}.stderrout.log ...


0

OSX 10.9+ solution with no third-party software: In OSX 10.9 and above, you can use the AppleScript command display notification to display a growl from the terminal like so: osascript -e 'display notification with title "Process Completed."' If you don't want to type all that every time, you can use an alias: alias growl='osascript -e "display ...


0

you want to test for not running set appname to “Applications/Cubase 5.app” tell application appname to launch repeat until application appname is not running delay 1 end repeat if application appname is running then do shell script "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist" ...


1

else: endif not found. This and the others are all csh error messages. Somehow you're invoking csh on that host instead of bash. You'll have to check the remote system to find out exactly why that's happening. Someone may have set up an alias to invoke csh instead of bash, or they may have replaced the bash executable program, or something along those ...


1

There are two stages: first you need to escape any special characters in $ip: echo $ip|sed 's#[./&?]#\\&#g' Then you need to perform the substitution: sed -i "s/^mysql\.unmetric\.twt\.url.*$/replacement/g" filename Together these give: sed -i "s/^mysql\.unmetric\.twt\.url.*$/$(echo $ip|sed 's#[./&?]#\\&#g')/g" filename Note that the ...


5

#!/bin/bash read -p "Enter a file suffix (like .txt): " ending files=( *"$ending" ) echo "found ${#files[@]} files with that suffix" Don't parse ls. This stores the filenames in an array, then prints out the size of the array.


0

For a Mac, use pbcopy (pasteboard copy): cat file.txt | pbcopy The contents of file.txt are now on the clipboard for pasting into another application (e.g. browser). You can also paste the contents of the clipboard into a file using pbpaste: pbpaste > file.txt While this doesn't involve vi specifically it does achieve the same goal on a Mac.


0

Short answer: echo "set horizontal-scroll-mode off" >> ~/.inputrc Bit longer answer: In an interactive bash shell, user input is handled by the READLINE library (look for it in bash man page to get more informations). Per bash documentation, the default behaviour is to wrap to a new line when the input is longer than the screen width. You can ...


1

Assuming you have bash version 4: declare -A exceptions=( [example_1_some_suffix.png]=skip [some_prefix_example_2.png]=skip [example_3.png]=skip [example_4.png]=skip [example_a.png]=skip ) for image in *.png; do [[ "${exceptions["$image"]}" == skip ]] && continue # ... Without using associative arrays: exceptions=( ...


1

You can turn on extglob to be able to specify the mask in more detail shopt -s extglob for image in ?(a)+(b)*.png ; do ... If you just want skip a given file, you can do for image in *.png ; do [[ $image == file-to-skip.png ]] && continue ...


0

@sqweek's answer above is awesome, though I suspect he has a bug in his awk script for generating parent directories, as it gives me e.g.: $ echo a/b/c/d | awk -F/ '{print; while(/\//) {sub("/[^/]*", ""); print}}' a/b/c/d a/c/d a/d a I was able to fix it by using gensub instead: $ echo a/b/c/d | awk -F/ '{print; while(/\//) { $0=gensub("(.*)/[^/]*", ...


3

With bash and zsh you can use Process Substitution: source <(./myPythonScript -outputZSHSettings)


6

For an interactive shell, pressing Ctrl+x followed by * after typing the glob pattern will edit your command line with that glob pattern expanded. From the bash man page: glob-expand-word (C-x *) The word before point is treated as a pattern for pathname expansion, and the list of matching file names is inserted, replacing the ...


6

Just use echo...put it in front of the command you want to expand. I use this quite frequently. $ ls one.txt two.txt three.dat $ echo rm *.txt rm one.txt two.txt $ rm *.txt You can use Home and Del to quickly add/remove the preceding echo. EDIT As pointed out in the comments, this will not work if the command is not just a simple command (like if it is a ...


0

If you want to see how arguments are expanded or tokenized, you can use a program or script that prints out its arguments. Here's one implementation in bash: #!/bin/bash for (( i = 0; i <= $#; ++i )); do printf 'argv[%d] = %s\n' $i "${!i}" done Assuming you put that in a file called printargs.sh (and made it executable), then you would get output ...


11

You can use set -x. For example, consider the script: $ cat script.sh set -x echo * When run, it shows the expanded echo statement before actually executing it: $ bash script.sh + echo file1 file2 file3 script.sh file1 file2 file3 script.sh And, as Kundor points out, this also works interactively on the command line: $ set -x + set -x $ echo * + echo ...


1

The statutility, which is handy for getting file statistics, can also give you informations about file systems, just supply the -f option. But be sure that you supply the mount point (e.g. /boot) and not the device file (/dev/sda1)! Because in the latter case stat will report statistics of the /dev file system, which is (on debian) a virtual filesystem and ...


0

Niraj - Have you looked at the di utility? This might offer at least an easier way to extract the data you need, it offers a CSV format output of the drive space. di -c


0

If your distribution uses PAM, you could set your environment variables in your ~/.pam_environment file.


0

The first error here is in thinking that the shell just runs fork() to execute an external command and that the description of fork() is thus a description of the operation of the shell. In reality both the parent and the child process do a whole lot of additional stuff. And in particular the child calls execve() to run the external command. At this ...


0

I typically end up doing build and captures to deploy an image to mulitple identical computers. For installing things and chhanging configuration (including autologin), Windows Embedded Standard 7 supports using SetupComplete.CMD. Here is a short description from Microsoft. A couple of caveats: It is only run if you run sysprep on the machine No user ...


0

USE ggVG. type "gg" to go at top of the test Then type VG.


0

Setting directory variable like this: export set SAMTOOLS_DIR="/home/laba/Desktop/samtools/samtools-1.1" And then calling the exacutable from the script like this: $SAMTOOLS_DIR/samtools [parameters] solves the problem



Top 50 recent answers are included