Search Results

Search: Posts Made By: knc9233
12,865
Posted By knc9233
awk split characters
BEGIN{
printf ("%s\t%s\t%s\t\n", "First Char", "Last Char", "Total Chars");
}
{
chars = split($1, line, //);
charline = line[chars];
firstchar = line[1];
...
3,734
Posted By knc9233
the uid displays as the number and not the...
the uid displays as the number and not the username...how do i get the username instead of the number?
3,734
Posted By knc9233
yea that does make more sense...thanks!
yea that does make more sense...thanks!
3,734
Posted By knc9233
cut question
#!/bin/bash

echo "UserName PID Command"
ps -ef > ps.temp
grep '^[a-z]\{2,3\}[0-9]\{4\}' ps.temp > ps.temp2
cut -f1,2,8 ps.temp2
rm ps.temp*

I am having some problems with the cut...
2,939
Posted By knc9233
thanks a lot :)
thanks a lot :)
2,939
Posted By knc9233
egrep field print
#!/bin/bash

dnum=0
cd rc.d

while [ $dnum -le "6" ]
do

echo "rc$dnum.d outputs"

egrep -r '^[K|S][0-9][0-9][a-z]+' rc$dnum.d | sort -n +3

((dnum++))
done
...
7,544
Posted By knc9233
awk: redrect printf to file and sort
{ printf "%s %6.2f\n", UserName, pay > payroll_report | sort -nk2 payroll_report; }

this is what I have but it doesnt write the payroll_report file and gives a syntax error for the pipe...help??
2,012
Posted By knc9233
if [ $i -le $c ] then ...
if [ $i -le $c ]
then
echo "Creating Backups..."

if [ -f $f.1 ]
then
cp -v $f.$i $f.$j
...
2,012
Posted By knc9233
backing up file everytime script run and saving other backups
how would i go about creatng a backup of a file everytime a script is run so that the next time it is run the old backup gets pushed back and the most recent backup is 1st.
(new)backup.1...
26,686
Posted By knc9233
redirect stderr and/or stdout to /dev/null from command line
Is it possible to redirect errors at the command line when you run the script such as bash scriptname & 2>/dev/null?
1,956
Posted By knc9233
thanks worked!
thanks worked!
8,387
Posted By knc9233
create log file
Accept command line input of a directory
keep a .logfile of the contents of the directory inputed
if a .logfile does not exist create one for the file that is missing a .logfile and create a...
1,956
Posted By knc9233
Need to display sorted output on 1 line!
#!/bin/bash
{ [ $# -ge 1 ] && [ $# -le 5 ]; } || {
echo "Must enter between 1 and 5 parameters"
exit 1
}

for P
do
echo $P >> /tmp/task3
done

echo "SORTED: $(sort...
4,101
Posted By knc9233
#!/bin/bash [ $# -eq 1 ] || { echo...
#!/bin/bash

[ $# -eq 1 ] || {
echo "Must Input Date: mm/dd/yyyy"
exit 1
}

FDATE="$1"
OLDIFS="$IFS"
IFS="/"
set $1
IFS="$OLDIFS"

[ $# -eq 3 ] || {
echo "Must...
4,101
Posted By knc9233
nvm on the errors just noticed i was missing that...
nvm on the errors just noticed i was missing that quote!
4,101
Posted By knc9233
yeah not looking for an input line want it right...
yeah not looking for an input line want it right off the command line. (shell scriptname date)

i'm trying to use IFS and separate the input by the "/". script currently looks like...
#!/bin/bash...
4,101
Posted By knc9233
when i input a month of 13 now i get it bumped to...
when i input a month of 13 now i get it bumped to january. i do the input from the command line, so i need to read the month from there and determine if it is over 12 and display an error stating...
4,101
Posted By knc9233
thanks. that worked. do you know how I would make...
thanks. that worked. do you know how I would make it work so if 13 was inputed as the month it would print an error?
2,475
Posted By knc9233
FILENAME=$( find -type f ) CHARS=$( wc -m...
FILENAME=$( find -type f )
CHARS=$( wc -m $FILENAME )
echo "$FILENAME $CHARS"

put that in the do and it worked
2,475
Posted By knc9233
xargs...not what i was looking for i figured it...
xargs...not what i was looking for
i figured it out.
thanks tho
4,101
Posted By knc9233
Date formatting
Running bash how do I input the date in the command line like 3/20/90 and get an output formmated like March, 20 1990.
2,475
Posted By knc9233
For Loop
Write a simple for loop that processes each file in the present working directory (PWD) and outputs the filename and number of characters in that file. Hint, you will use the cat and wc commands. ...
Showing results 1 to 22 of 22

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