New answers tagged

0

Command substitution $(...) turns output into arguments. It first needs the whole output, because it's not possibly to supply arguments dynamically one by one.


0

Try this simple line, It will terminate all script.py: pkill -9 -f script.py


0

JavaScript key code for Ctrl is 17 you can check here for Javascript Key Codes


1

#!/bin/bash ##Sorry for bad English. ##usage: script_name.sh silicon valley ##This urlencode fonction is from github project but I couldnt remember who is creator. urlencode() { # urlencode <string> local length="${#1}" for (( i = 0; i < length; i++ )); do local c="${1:i:1}" case $c in [a-zA-Z0-9.~_-]) ...


2

find can print any of the 3 timestamps a file/directory can have. You just have to use -printf with the appropriate format sequence: %C@ or %A@ or %T@ (see the detail is man find). As for empty directories, checking if $? is 0 can be misleading because 0 return code means "nothing bad has happened", and an empty directory does not count "something bad", ...


1

The cronjob may very well be running - however you have provided no redirection of its output (stdout), so it has no where to be displayed. The tasks launched by cron are responsible for their own logging / output - cron provides no output redirection capability. You can have the the cron job launch a terminal and then run your script in it; here is an ...


2

How do you know that "nothing happens"? Just because the script doesn't pop up in a window on your screen, doesn't mean it is not running. Cron is made for "batch" tasks, not for starting interactive programs, so not only it won't automagically launch a terminal window for you (though that could be done manually), most of the time it can't launch any ...


2

The sudo configuration by default will reset the path regardless of how sudo is called. Here are two common ways to work around this, the first is the permanent change, the second is a command line argument to sudo (which you could add as an alias). permanent & global change In /etc/sudoers you need to modify two settings: sudo visudo In the sudoers ...


2

sudo does not, by default, use your path, and does not run root's bashrc or equivalent. See http://askubuntu.com/q/128413 for a full description.


0

/tmp is the directory for temporary files. This is the one place you never want to put anything you want to keep. /root is the home directory and is a reasonable place to put your script. You may want to put experimental scripts there. The traditional place for local scripts is /usr/local/bin or /usr/local/sbin. These files will be kept over reboots. ...


4

You are using an anti-pattern, in that you should never use a for loop to iterate over the output of a find command. It's a little similar to parsing ls output, which you should also never do. Instead, use find's built in ability to run commands: find /home/rmintz/Documents/ -type f -name "*jpg" -exec echo {} \; Here, the {} is replaced with the name of ...


0

I want it to be done for a set of csv files in a folder Again, your batch file is broken in many different ways. You need to learn how to debug your own batch files: See Debugging your batch files for some hints. To debug you also need to check the syntax of the commands your are using. See An A-Z Index of the Windows CMD command line. Rather than ...


0

You need a for loop: cd ~/Desktop/344/08 for arg in --resources --requesters --errors do echo Starting: ./log_parse.sh "$arg" --day 10-20 --number 10 access_log_Jul95 ./log_parse.sh "$arg" --day 10-20 --number 10 access_log_Jul95 done Maybe you will want to save a copy of the output to a logfile as well as display it on a screen: cd ...


0

It was as simple as this: @ECHO OFF SETLOCAL set /p Input= Drop file here, and click enter. set ffmpeg=C:\Windows\User\ffmpeg.exe set file=%Input% FOR %%i IN (%file%) DO ( ECHO filedrive=%%~di ECHO filepath=%%~pi ECHO filename=%%~ni ECHO fileextension=%%~xi ECHO %filename% ) %ffmpeg% -i %Input% -an -c:v libx264 -preset medium -crf 22 ...


0

Haven't found a solution like what you're looking for, but this vlc add-on designed to skip radio ads might be a good place to start. It may be easily editable to fit your needs (especially if you have experience with basic programming.) Good Luck!


0

Just to make it clear: I forgot the "!" (exclamation mark). That's explain everything. #!/bin/bash


2

Redirect the stdout to /dev/null by appending > /dev/null to any command: apt-get update > /dev/null To also redirect stderr to /dev/null append 2>&1: apt-get update > /dev/null 2>&1 To upgrade or install packages without being prompted for [Y/n] add -y: apt-get upgrade -y > /dev/null 2>&1 apt-get install ...


1

You can issue the command apt-get install ${package_list} and all packages in the the package-list variable will be installed if possible. There are tools that will give you lists of installed packages. You should remove any packages installed as dependencies, as well as packages installed by default. Look at the command listed by man -k apt. If you ...


2

I found the GIMP Saver Plugin that does exactly that and a little more. I mapped it to Ctrl+E.  Now Ctrl+E just saves the plain image and I'm done!  perfect!  I left Ctrl+Shift+E to "Export as", which is the only one I use anyway. It is perfect for those times when you have to visually tweak a dozen JPEGs and you can't just use ImageMagick.



Top 50 recent answers are included