Search Results

Search: Posts Made By: peuceul
2,893
Posted By peuceul
Ok, I found a similar way sed '1i\ > your...
Ok, I found a similar way
sed '1i\
> your text goes here' test.cpp > testfile.txt


thank you everyone!:b:
2,893
Posted By peuceul
I have a test.cpp with a "1" on the first line. I...
I have a test.cpp with a "1" on the first line. I want to copy this respective file to other file with additional lines in line 12..
2,893
Posted By peuceul
---------- Post updated at 05:31 AM ----------...
---------- Post updated at 05:31 AM ---------- Previous update was at 05:30 AM ----------



still does not update the output.txt .. it consist only "1" even after I removed the old output.txt
2,893
Posted By peuceul
sed insert new line does not update file
Hi all,

I have a file called "text.cpp" with the first line of "1"
afterwards I tried in Ubuntu to type the following

sed '12iasdasdasdasdsad' test.cpp > output.txt

however when I tried to...
2,150
Posted By peuceul
awk top not getting the "k" result
Hi all,

I have the script :
top -n 1 | awk '{ if (NR==4) print $5 }'

It will return me with one memory usage : for instance
3134720k

However, I need to be returned only the number :...
1,847
Posted By peuceul
awk to txt provide strange character
Hi all,

I executed this script
top -n 1 | awk '{ if (NR==3) print $2 }'and it will give me in console
'31.6%us,'however, if I put the same script in txt file
top -n 1 | awk '{ if (NR==3) print...
21,141
Posted By peuceul
yes. sorry my mistake. ok i did it : df -k |...
yes. sorry my mistake. ok i did it :
df -k | grep -v used | awk '{ print $6 "\t" }'
21,141
Posted By peuceul
shows me empty lines..
shows me empty lines..
21,141
Posted By peuceul
parsing df column values
Hi all,

I need to run df, and parse the value under column of "Mounted on"

For instance, my df is

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 ...
1,546
Posted By peuceul
Shell script : value under 1 (0,0...) is accepted as 0?
Hi all,,

I have this script
ctr=$(( 1/1000 ))
while [ 1 ]
do
echo $ctr >> test.txt
doneHowever, it puts 0 instead of 0.001

How can I put 0.001 in the text file?

Thank you
3,723
Posted By peuceul
shell script : log to txt and insert new line everytime
Hi,

I have this script,

while [ 1 ]
do
ps ax|grep 5060 > log.txt
echo " "
sleep 1
done
}

I want to actually put a new line everytime the...
1,177
Posted By peuceul
how to specify number of argument in shell
Hi I am new in shell,

I am trying to create a small script that can do exit if a script is executed when argument not 2
#!/bin/sh
if [ $# -gt 2]; then
echo greater
exit 1;...
9,454
Posted By peuceul
Thank you all. How do I mark this thread as...
Thank you all. How do I mark this thread as solved?
9,454
Posted By peuceul
[Solved] save the return value of a unix command
Hi all,

I am new in linux script, and I have the code below

#!/bin/bash
CMD="shuf -i 1-5 -n 1"
$CMD
echo $CMD
exit 0
if I run the $CMD, it will return me a shuffle value. However, I...
Showing results 1 to 14 of 14

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