Search Results

Search: Posts Made By: johnnybananas
1,978
Posted By johnnybananas
apologies, this is what i have cat $1 | awk...
apologies, this is what i have

cat $1 | awk -F, '{print $1 "," $2}' | sed '1d' | sed 's/IE//' | sed 's/^\(.\{7\}\)/\1 /' | sed 's/^\(.\{9\}\)/\1 /' | sed 's/,/ /' | awk '{ print $4 " " $1 " " ...
1,978
Posted By johnnybananas
Convert date format
Hi guys
I am looking to convert this kind of entry in a txt file

26/04/2008

to

April 2008


Note : this is not using the date command , these are date entries in a file

can i do this...
8,632
Posted By johnnybananas
excelent thanks . i really like the read -n1...
excelent thanks . i really like the read -n1 buffer
8,632
Posted By johnnybananas
can you explain the following to me ? grep...
can you explain the following to me ?

grep -v grep
if [ -n
read -n1 buffer
case $buffer in
8,632
Posted By johnnybananas
You do need to catch the proccess id (pid) of the...
You do need to catch the proccess id (pid) of the passed argument ($1) into a new variable, and 'kill that'..

How can i catch the process id of the passed arguement ? I just need to awk for the...
8,632
Posted By johnnybananas
I want to use the awk command like in my above...
I want to use the awk command like in my above script
8,632
Posted By johnnybananas
using awk as i just want to get familiar with the...
using awk as i just want to get familiar with the command
8,632
Posted By johnnybananas
Using awk to kill a process
Hi Guys
I am running a small script to find a process id , ask user if they want to kill the process and then action it Yes or no

Here is what i have

#/bin/bash


ps -l | grep -i $1 | awk...
3,200
Posted By johnnybananas
awsome thanks for all the help. working fine now
awsome thanks for all the help. working fine now
3,200
Posted By johnnybananas
Your first case above is what i am using and...
Your first case above is what i am using and thats not working. It works ok if user enters input but not working if i just press enter and enter nothing

yeah i fixed the outputs, thanks
3,200
Posted By johnnybananas
I must be annoying you so apologies for that ...
I must be annoying you so apologies for that

yeah i thought that myself that it should be $dir so last time now i promise, here is my code

If i enter a dir then it works fine but its now not...
3,200
Posted By johnnybananas
but i dont want to supply parameters calling the...
but i dont want to supply parameters calling the script. I just want the script to execute and ask the user what dir they want to check

if the user just presses enter without entering a dir then...
3,200
Posted By johnnybananas
parameter count, yes so if 0 then set dir to pwd...
parameter count, yes so if 0 then set dir to pwd and if 1 (the user enters a dir) then set dir to that value ?

---------- Post updated at 05:04 AM ---------- Previous update was at 04:53 AM...
3,200
Posted By johnnybananas
ok . i must be missing something here. i thought...
ok . i must be missing something here. i thought that the case statement would change dir to $pwd if there was no entry by the user and if there was 1 entry then it would change dir to that entry $1 ?
3,200
Posted By johnnybananas
entering the answer to be read into dir user...
entering the answer to be read into dir

user is asked what dir - if they type in a dir then the script isnt acting on it, its still acting on pwd
3,200
Posted By johnnybananas
thanks for your help. I have it all working now...
thanks for your help. I have it all working now except for if the user specifies a directory. The script still runs on the current directory. Any idea why $1 isnt being interpreted ?


#/bin/bash...
3,200
Posted By johnnybananas
thanks guys I am just trying to find read,...
thanks guys

I am just trying to find read, not "at least read"

Ok i have added the following at the top of the script

case $# in
0) dir=${dir:-.}
esac
echo $dir
fileread....

When i...
3,200
Posted By johnnybananas
im getting bad substitution on that case $#...
im getting bad substitution on that

case $# in
0) dir=${dir.-.}
esac
3,200
Posted By johnnybananas
If no input then set directory to current
Hi GUys

I have a script where i am counting the number of files that the user has read permissions to in a folder . They are asked for this folder at the start

if they dont enter anything then...
Showing results 1 to 19 of 19

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