Tag Info

Hot answers tagged

2

When referencing For loop variable within a batch file you need to double up the percent signs (ie: %%a), but if you do this when just running the command straight at the prompt it won't work. You need to change them to a single percent sign (%a). Perhaps check out this other SU question for more info: What does the percent sign (% and %%) in a batch file ...


2

You can use aspell -a to do this, and take the file from stdout. This will output the word with line number and alternate spellings: cat example.txt | aspell -a To clean up your list better, I'd use something more like: cat aspell.txt | aspell -a | cut -d ' ' -f 2 | grep -v '*'


2

Changing the default program to open a file extension won't affect the behaviour of other programs that use that file, so opening your .java files in Notepad++ won't be a problem when compiling them. If in command line, you can use the program name if you want to open with a different program than the default, for example: notepad.exe test.html As long ...


2

Assuming there are only regular files and no funny things like subdirectories or other file like objects. find -not -newermt "Mar 31 08:04" -delete To see which files are going to be deleted run without -delete first. -not -newermt means to find files which modification time is older than the given time string. The time string is parsed like the date ...


1

Have you attempted to use some of the timing options of ncat? Here's the relevant event excerpt from man ncat(1). TIMING OPTIONS These options accept a time parameter. This is specified in seconds by default, though you can append ms, s, m, or h to the value to specify milliseconds, seconds, minutes, or hours. -d time, --delay time (Specify ...


1

It isn't true that alias is used only to navigate folders. It can be used for other commands as well (that's why it's called alias). In example: alias arestart='sudo apachectl restart' alias alog='tail -f /var/log/apache2/error_log' and place them in ~/.bashrc or ~/.bash_profile. Or you may want to put all your alias definitions into a separate file ...


1

Your awk is looking at the file names and not at the file contents. Here is a better approach: find ./ -type f -execdir grep "<!--.*-->" "{}" + This uses find to get a list of all the files and then feeds these into grep which searches for the text you are seeking. It will then output the name of any matching file followed by a colon (:) and the ...


1

ls -R will list only the file name not a file contents. You can do this in a more simple way using grep command. grep -rn '<!--.*-->' Or if want to do this using awk then you can use cat * to list all file content in a directory. cat * | awk '/<!--/,/-->' Note: This approach works only if your directory contains files. If you want to ...


1

I would skip the startup menu and use the registry instead. Your program can run the following command: REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "My App" /t REG_SZ /F /D "C:\MyAppPath\MyApp.exe" for the whole system (all users) or REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "My App" /t REG_SZ /F /D ...


1

You can put inside other scripts' content pause > nul to pause them without displaying Press any key to continue . . . on the screen.


1

This is a batch script I have been working on. It is small and might not work. You need to place this in your .minecraft folder where the file launcher_profiles.json should be. All you need to do is enter a username, and then it will change text in a file named launcher_profiles.json. You will need to type in your current username or the username you last ...


1

wmic path win32_VideoController get name does the job concisely from commmand line. Thanks to Vlastimil Ovčáčík's answer above but not sure why its so verbose.


1

Since you're on gnu sed you could use 'e [COMMAND]' This command allows one to pipe input from a shell command into pattern space. on the la$t line: sed '$e cat insert.txt' file With ed (replace ,p with w if you want to edit-in-place): ed -s file<<IN - r insert.txt ,p q IN or ed -s file <<< $'-1 r insert.txt\n,p\nq\n' ...


1

You have incorrect backslashes. The expression \< does not match a literal left broket -- an unescaped < matches itself just fine, but with the backslash, you change it into a left word boundary zero-width assertion, which can never happen next to a slash; so the expression \</code> can never match anything. With some minor refactoring to also ...


1

You have added the location to the .exe file named tcc.exe in your path. What you should do is add the location of the folder containing the tcc.exe file. So in your case the environmental path variable should be like this ...


1

It seems that the ANSI codes are messing with your terminal, possibly due to some interactions with the other contents of PS1 or because you do not reset to default. Luckily, in zsh there is no need to use ANSI escape codes. You can use %F{color} and %K{color} to set foreground and background colors respectively and %f and %k to reset default values (See ...



Only top voted, non community-wiki answers of a minimum length are eligible