Tag Info

New answers tagged

2

You need to store the count somewhere it will persist across multiple runs of the script, since variables are just in memory for that single run. The easiest place is probably in a file. The particular way you store it in a file depends on a few factors including how many times you're counting, and whether you expect concurrent runs. A simple robust way ...


1

Install the package inoticoming sudo apt-get install inoticoming Create wrapper script watch_output: #!/bin/bash backup_folder="$HOME/backups" filename="$1" mkdir -p "$backup_folder" if [ "$filename" == "output.txt" ] then echo "New or changed file \"output.txt\" in $2" mv "$2/$filename" "$backup_folder/${filename%.*}.$(date ...


3

First install the package inotify-tools: sudo apt-get install inotify-tools A bash script would help #! /bin/bash folder=~/Desktop/abc cdate=$(date +"%Y-%m-%d-%H:%M") inotifywait -m -q -e create -r --format '%:e %w%f' $folder | while read file do mv ~/Desktop/abc/output.txt ~/Desktop/Old_abc/${cdate}-output.txt done What does this script ...


2

The script below will move and rename any file that might appear in a defined directory (dr1). It renames the files like: output_1.txt, output_2.txt` etc. The script looks "actively" if the targeted name already exists in directory 2 (not from a "blindly" chosen range), so you can start and stop the script at any time without the risk of overwriting existing ...


2

a= cut -f 1 abc.txt This doesn't work, this will assign the word 'command' cut to the variable a. The correct syntax is a=`cut -f 1 abc.txt` Now you can run the command echo $a and check the result. Works The second command cut -f 1 abc.txt >a This will redirect the output of the command cut -f 1 abc.txt into a newly created file named a ...


0

you can do it by editing the file located at .local/share/applications/mimeapps.list and this file looks like this according to my settings [Default Applications] text/x-python=geany.desktop text/html=geany.desktop [Added Associations] text/x-python=geany.desktop; text/html=geany.desktop; and you can change the opening of the html files using aptana ...


0

You can now try visual studio code. Microsoft's Visual Studio Code is an Integrated Development Environment (IDE) with support for Mac, Linux and Windows.


0

By reading man 5 core I have found what happens when a program crash. By setting core_pattern, I can launch something else than apport that fork-setuid-setgit-exec zenity.


1

Microsoft's Visual Studio Code is an Integrated Development Environment (IDE) with support for Mac, Linux and Windows.


-1

I know about detecting the system using simple ping command: TTL 64 Linux/BSD 128 Windows 255 UNIX You can change the default TTL, but it is usually the default one. Or try the nmap: nmap -O But you have to study these command (sources) to find the answer you need.


0

With my limited knowledge I can recommend both Python and C. As you may know there isn't a 'the best' language. You can see lots of discussion on the topic like the one in here or here or this link or this one that might also be help to you.



Top 50 recent answers are included