Search Results

Search: Posts Made By: newbie2010
1,055
Posted By RudiC
How about ls -1 /tmp/test/*CH*NDMP*.z; ls ...
How about
ls -1 /tmp/test/*CH*NDMP*.z; ls /tmp/test/*EX*NDMP*.z | sort -t- -k1,3 -k6r
/tmp/test/CARS-GOLD-NET_CHROMJOB-01-XZ-ARCHIVE-NDMP.z
/tmp/test/CARS-GOLD-NET_CHROMJOB-01-XZ-NDMP.z...
5,705
Posted By featheredfrog
You say you don't have date -d Do you have...
You say you don't have
date -d
Do you have the date command without the -d option? If you do, something like

$ date "+%Y"
2015
$
does the trick on my system. "man date" and search for...
1,200
Posted By sea
Try: [ "${#file}" -gt 7 ] && echo yes Note...
Try:

[ "${#file}" -gt 7 ] && echo yes
Note the hash char between the bracket and variable name.

hth
3,116
Posted By RudiC
Try tr , '\n' <file
Try tr , '\n' <file
2,021
Posted By Corona688
Try 0?8
Try 0?8
1,133
Posted By Aia
Would that work? Remove the echo if it does. ...
Would that work? Remove the echo if it does.
for file in *; do
if [[ "$file" =~ 02\\-[0-9]\{2\}-2015 ]]; then
echo cp "$file" /tmp/feb
fi
done
775
Posted By Don Cragun
If you don't identify what is using the regular...
If you don't identify what is using the regular expression, the requirements will often vary. In this case:
CAR[-_]
will match either of these strings anywhere in a line or file or string in you...
5,157
Posted By RudiC
Trying to infer your problem from post #1, I...
Trying to infer your problem from post #1, I guess it's a case problem, as -iname is needed but does not work. Try assigning VARY with the upper case partial file name and then find . | awk...
5,157
Posted By RavinderSingh13
Hello newbie2010, Following may help you in...
Hello newbie2010,

Following may help you in same, I tested in bash.
1st please check the file names which you want to delete, if satisfied with result use 2nd command.

VAR="PET-DOG"
find...
2,202
Posted By RudiC
I'd present the users a menu to select from; so...
I'd present the users a menu to select from; so there's no chance for mistyping anything.
2,202
Posted By rbatte1
Have you considered a case statement in your...
Have you considered a case statement in your script? - not to be confused with them entering the word case6 or CASESIX

Something like:-case "$ITEM" in
case1|CASEONE) # Do whatever case1...
4,519
Posted By MadeInGermany
You have escaped the space character twice, once...
You have escaped the space character twice, once by " " and another time with \.
Try
var2="X-0101 2-10-2013.txt"
1,842
Posted By jim mcnamara
Let's take this one run-on one liner and make it...
Let's take this one run-on one liner and make it usable. Cramming stuff into one
line may be cool but it prevents doing what you want.


# old
export tapes=$(for tape in $(su - nacct...
1,480
Posted By Scrutinizer
That is because of sed's greedy matching. It...
That is because of sed's greedy matching. It tries to match as much as possible. Therefore the first .* matches NC, and [A-Z]\{1,\} matches E
With the second command .* is forced to match the empty...
1,644
Posted By Don Cragun
You got exactly what you asked for. Let's expand...
You got exactly what you asked for. Let's expand the replacement string a little bit so we can see what each of your three parenthesized expressions matched:
echo AB1234|sed -n...
2,097
Posted By Corona688
gawk 'NR==1{ # For the very first line ( NR is...
gawk 'NR==1{ # For the very first line ( NR is line number )
for(i=1;i<=NF;i++) # Loop over all columns from 1 to NF (number of fields)
if($i~/FE/)f[n++]=i # If the field...
1,881
Posted By Scott
It goes together with the : to give a short-hand...
It goes together with the : to give a short-hand if-then-else notation.


# Set Y to 1 if X is "true", otherwise 0:
Y = (X == "true")?1:0;

# Is equivalent to:
if( X == "true" )
Y = 1;...
1,013
Posted By Corona688
To tell read not to interpret backslashes, do...
To tell read not to interpret backslashes, do read -r
1,013
Posted By blackrageous
Not sure if this helps or what you intend to do...
Not sure if this helps or what you intend to do with the variable...
This is for bash shell
read -p "Enter string: \\" str
str="\\${str}"
echo ${str}
1,202
Posted By Chubler_XL
@RudiC The OP has already stated that cat of...
@RudiC
The OP has already stated that cat of the file works fine, so I assume he/she has a properly setup .ssh/config file or the user is the same on both servers.

The issue reported here more...
1,202
Posted By Corona688
This is far more convoluted than it needs to be. ...
This is far more convoluted than it needs to be.

for X in $(ssh kitchen 'cut -f1 "/lister/filer1/volz/camera/Pictures\ Lists/Arizona/Photoy.txt"')
do
...
done
12,925
Posted By Scrutinizer
The standard way is tr -d '\r' < file.dos >...
The standard way is tr -d '\r' < file.dos > file.ux
874
Posted By Yoda
Use mailx instead: /usr/bin/mailx -s "Lists on...
Use mailx instead:
/usr/bin/mailx -s "Lists on $(date)" myname@compancy.com</tmp/list
1,209
Posted By neutronscott
Each line that contains CARS is skipped. It'll...
Each line that contains CARS is skipped. It'll display x once it comes across a line without CARS, yes. In the end it prints all the lines without CARS, but lagging behind a line (thus the need for...
1,577
Posted By Makarand Dodmis
Alsonawk 'BEGIN {print "List of Events" "\n"}...
Alsonawk 'BEGIN {print "List of Events" "\n"} {print $0}' file
List of Events

Tennis
Football

cat file
Tennis
Football
Showing results 1 to 25 of 87

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