Search Results

Search: Posts Made By: Hexes
13,720
Posted By Hexes
Ok so this script in from text1 file with some...
Ok so this script in from text1 file with some kind of text and numbers

#!/bin/bash
tr " " "\n"
grep '[02468]$' text1
tr "\n" " "


will print on the screen even numbers from text1 or...
13,720
Posted By Hexes
for example we have text.txt file: shell 6 3...
for example we have text.txt file:

shell 6 3 32 programming 2 5 7 9 6 scripting 4 3 1

after we run BASH script we should see result as
6 32 2 6 4
only even numbers of the text
13,720
Posted By Hexes
#!/bin/bash echo "input n" read n echo...
#!/bin/bash
echo "input n"
read n
echo "input m"
read m
m=`expr $m + 1`
x=`expr $m - $n`
head -$m text > text2
tail text2 > text3
cat text3
rm text2

well the script should look something...
13,720
Posted By Hexes
Even numbers from text file
Hello, i have started learning scripting with linux commands. So far I am having probelms with one task:

To make a script with from file with the text, prints even numbers used in that text.
...
Showing results 1 to 4 of 4

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