Search Results

Search: Posts Made By: knight_eon
2,046
Posted By knight_eon
NR is Special Variable in AWK which means Number...
NR is Special Variable in AWK which means Number of Line the process is on. Hence NR%100 will give you the remainder of NR/100. So here, if NR is 101, the NR%100 will give 1 which will invalidate...
2,720
Posted By knight_eon
And lil bit more change: awk -F'"' '{print...
And lil bit more change:

awk -F'"' '{print "project " $2, $6?$6:$4}' myfile.txt
14,914
Posted By knight_eon
You can put the script in Crontab for scheduling...
You can put the script in Crontab for scheduling it run at 3 AM or PM

As for the code, try this: This might help.


#!/bin/bash
...
1,496
Posted By knight_eon
Application: Want to be Forum Moderator
Hello Admin/Mods,

I am not sure, if this is the right way to apply, but out of passion, I will go ahead with tje request :)

I want to apply for the role of the Forum Moderator (specially for...
2,120
Posted By knight_eon
You can make two entries in crontab like this: ...
You can make two entries in crontab like this:


0,10,20,30,40,50 9-17 * * * job_script

0 17-9 * * * job_script
22,363
Posted By knight_eon
Oopps... We both posted nearly at the same time...
Oopps... We both posted nearly at the same time so did not see ur reply :P
I like $() more then `` because of aeshetic value and less confusion over `` and '' :)
2,486
Posted By knight_eon
Sorry for the late response. You already got the...
Sorry for the late response. You already got the reply. I have started to love AWK and trying to learn the same. So can we do something like this:


ps -ef | awk '{if ($2 == 4063 && $3 == 1)...
22,363
Posted By knight_eon
It should be: a="a b c" echo "the...
It should be:


a="a b c"
echo "the middle is $(echo $a | awk '{print $2}')"


[PS: U should keep your Codes/Output in CODE Tag. Mods don't like unformatted codes and output. SO next time...
2,030
Posted By knight_eon
Welcome :)
Welcome :)
59,783
Posted By knight_eon
Hi,,, Through shell scripting, it is not...
Hi,,,

Through shell scripting, it is not an easy task to export to Excel file. Though one can do is that they can create one CSV file from the given data as mentioned in below script. After the...
4,133
Posted By knight_eon
You can try: find . -name '*.exe' ...
You can try:


find . -name '*.exe' -print | xargs ecasound -i stdin -o jack


Do let us know if this works... I am not sure if I can pass the argument to ecasound command like that. But...
3,555
Posted By knight_eon
And much better will be: [[ -f...
And much better will be:



[[ -f src_file ]] && cp src_file dest_file 2>/dev/null



So with above code, even if you don't have the source file, the script won't call cp command...
2,030
Posted By knight_eon
Try: #!/bin/ksh FS[1]="\/$" awk...
Try:


#!/bin/ksh
FS[1]="\/$"
awk '/'"${FS[1]}"'/ {print $(NF-1)+0}' df.tmp
2,287
Posted By knight_eon
Are you trying to compute the difference in...
Are you trying to compute the difference in alertperiod=`echo"($changeperiod - $remindperiod)"`
If that is the case:

# changeperiod=7257600
# remindperiod=691200
#...
5,170
Posted By knight_eon
Try this: # ls -ltrR .: total 24 ...
Try this:


# ls -ltrR
.:
total 24
-rw-r--r-- 1 root root 0 Feb 7 13:51 bin.sh
drwxr-xr-x 2 root root 4096 Feb 7 14:10 bneo
-rw-r--r-- 1 root root 0 Feb 7 14:15 script.txt...
2,287
Posted By knight_eon
And if you can please pass on the output / error...
And if you can please pass on the output / error of the script, don't you think it may help the people around to give the solution steadfast?

Secondly, I could run the script that you posted...
6,191
Posted By knight_eon
Sorry, but unable to understand what you need? ...
Sorry, but unable to understand what you need?

Here are some conclusions in codes:


# x=$(ls -ltr)
# echo "$x"
total 20
-rw-r--r-- 1 root root 58 Feb 7 12:29 data
-rw-r--r-- 1 root...
8,447
Posted By knight_eon
It can be written in sed one liner. Here is how: ...
It can be written in sed one liner. Here is how:


$ cat data
Knight Eon
Hello WORLD
Hello Earth
LINE
How is everyone
$ sed -e 's/\(\L.*\)/\1]Foo/g' data
Knight Eon
Hello WORLD]Foo
Hello...
8,447
Posted By knight_eon
Try something like this: I will add Eon at the...
Try something like this:
I will add Eon at the end of the line

$ cat data
Knight Eon
Hello World
Hello Earth
How is everyone

$ sed -e '$s/\(.*\)/\1Eon/g' data
Knight Eon
Hello World...
1,270
Posted By knight_eon
Data File Example: $ cat data Knight Eon...
Data File Example:

$ cat data
Knight Eon >,,,,
Hello World >,,
Hello Earth >
How is everyone >,,,,,, Around >,, Yo >,


The relevant SED Script:

sed -e 's/>,*/>/g' data


Output:
...
2,299
Posted By knight_eon
This should help #!/bin/bash ...
This should help


#!/bin/bash

while read F_FIELD; do
awk -F',' '/^'"$F_FIELD"'/ {print $0}' Input1.txt >> output

done < Input2.txt
1,155
Posted By knight_eon
/usr/bin/sediff "s/\$PROJECT/$PROJECT/"...
/usr/bin/sediff "s/\$PROJECT/$PROJECT/" /ananth/TEMPLATE
4,966
Posted By knight_eon
You can do like this for the Destination...
You can do like this for the Destination Directory:


#!/bin/bash

OLD_HIST_DIR="/var/log/user_history/old_logs"
HIST_DIR="/var/log/user_history"
...
6,308
Posted By knight_eon
Lets assume (assume since you have not given...
Lets assume (assume since you have not given complete names and detaios properly)

Your list file name is: img_list.txt whose content is something alike:
111111
222222
333333
444444

...
4,966
Posted By knight_eon
PART A: Script user_whtever.sh ...
PART A:

Script user_whtever.sh

#!/bin/bash

mkdir -p /var/log/user_history/old_logs # If the folder is not present, it will be created automatically

cp -p...
Showing results 1 to 25 of 62

 
All times are GMT -4. The time now is 08:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy